//FILE GENERATED AUTOMATICALLY BY GENERATE_PRIMITIVE IN EXTRAS
#include "glprimitive.h"

#include <QtOpenGL>

#include "graphics/material.h"

#include "math/matrix4f.h"

#include "math/vector3f.h"

void GLPrimitive::sphere(float r, Material *mat, Matrix4f *t){
	glPushMatrix(); 
	float transform[16]; 
	t->get(transform); 
	glMultMatrixf(transform); 
	//SPHERE DIV 2
	//PARAM: r : ray

if(mat!=NULL){

	mat->gl();

}
	glBegin(GL_TRIANGLES);
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.408248,0.408248,0.816497);
	glVertex3f(r*0.408248,r*0.408248,r*0.816497);
	glNormal3f(0.816497,0.408248,0.408248);
	glVertex3f(r*0.816497,r*0.408248,r*0.408248);
	glNormal3f(0.408248,0.816497,0.408248);
	glVertex3f(r*0.408248,r*0.816497,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0.707107,0.707107);
	glVertex3f(r*0,r*0.707107,r*0.707107);
	glNormal3f(0.408248,0.408248,0.816497);
	glVertex3f(r*0.408248,r*0.408248,r*0.816497);
	glNormal3f(0.408248,0.816497,0.408248);
	glVertex3f(r*0.408248,r*0.816497,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0,r*0.707107);
	glNormal3f(0.816497,0.408248,0.408248);
	glVertex3f(r*0.816497,r*0.408248,r*0.408248);
	glNormal3f(0.408248,0.408248,0.816497);
	glVertex3f(r*0.408248,r*0.408248,r*0.816497);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0.707107,0);
	glVertex3f(r*0.707107,r*0.707107,r*0);
	glNormal3f(0.408248,0.816497,0.408248);
	glVertex3f(r*0.408248,r*0.816497,r*0.408248);
	glNormal3f(0.816497,0.408248,0.408248);
	glVertex3f(r*0.816497,r*0.408248,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0.92388,0.382683);
	glVertex3f(r*0,r*0.92388,r*0.382683);
	glNormal3f(0.408248,0.816497,0.408248);
	glVertex3f(r*0.408248,r*0.816497,r*0.408248);
	glNormal3f(0.382683,0.92388,0);
	glVertex3f(r*0.382683,r*0.92388,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,1,0);
	glVertex3f(r*0,r*1,r*0);
	glNormal3f(0,0.92388,0.382683);
	glVertex3f(r*0,r*0.92388,r*0.382683);
	glNormal3f(0.382683,0.92388,0);
	glVertex3f(r*0.382683,r*0.92388,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0.707107,0.707107);
	glVertex3f(r*0,r*0.707107,r*0.707107);
	glNormal3f(0.408248,0.816497,0.408248);
	glVertex3f(r*0.408248,r*0.816497,r*0.408248);
	glNormal3f(0,0.92388,0.382683);
	glVertex3f(r*0,r*0.92388,r*0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0.707107,0);
	glVertex3f(r*0.707107,r*0.707107,r*0);
	glNormal3f(0.382683,0.92388,0);
	glVertex3f(r*0.382683,r*0.92388,r*0);
	glNormal3f(0.408248,0.816497,0.408248);
	glVertex3f(r*0.408248,r*0.816497,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.382683,0,0.92388);
	glVertex3f(r*0.382683,r*0,r*0.92388);
	glNormal3f(0.408248,0.408248,0.816497);
	glVertex3f(r*0.408248,r*0.408248,r*0.816497);
	glNormal3f(0,0.382683,0.92388);
	glVertex3f(r*0,r*0.382683,r*0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0,r*1);
	glNormal3f(0.382683,0,0.92388);
	glVertex3f(r*0.382683,r*0,r*0.92388);
	glNormal3f(0,0.382683,0.92388);
	glVertex3f(r*0,r*0.382683,r*0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0,r*0.707107);
	glNormal3f(0.408248,0.408248,0.816497);
	glVertex3f(r*0.408248,r*0.408248,r*0.816497);
	glNormal3f(0.382683,0,0.92388);
	glVertex3f(r*0.382683,r*0,r*0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0.707107,0.707107);
	glVertex3f(r*0,r*0.707107,r*0.707107);
	glNormal3f(0,0.382683,0.92388);
	glVertex3f(r*0,r*0.382683,r*0.92388);
	glNormal3f(0.408248,0.408248,0.816497);
	glVertex3f(r*0.408248,r*0.408248,r*0.816497);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.92388,0.382683,0);
	glVertex3f(r*0.92388,r*0.382683,r*0);
	glNormal3f(0.816497,0.408248,0.408248);
	glVertex3f(r*0.816497,r*0.408248,r*0.408248);
	glNormal3f(0.92388,0,0.382683);
	glVertex3f(r*0.92388,r*0,r*0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0,r*0);
	glNormal3f(0.92388,0.382683,0);
	glVertex3f(r*0.92388,r*0.382683,r*0);
	glNormal3f(0.92388,0,0.382683);
	glVertex3f(r*0.92388,r*0,r*0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0.707107,0);
	glVertex3f(r*0.707107,r*0.707107,r*0);
	glNormal3f(0.816497,0.408248,0.408248);
	glVertex3f(r*0.816497,r*0.408248,r*0.408248);
	glNormal3f(0.92388,0.382683,0);
	glVertex3f(r*0.92388,r*0.382683,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0,r*0.707107);
	glNormal3f(0.92388,0,0.382683);
	glVertex3f(r*0.92388,r*0,r*0.382683);
	glNormal3f(0.816497,0.408248,0.408248);
	glVertex3f(r*0.816497,r*0.408248,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.816497,0.408248,-0.408248);
	glVertex3f(r*0.816497,r*0.408248,r*-0.408248);
	glNormal3f(0.408248,0.408248,-0.816497);
	glVertex3f(r*0.408248,r*0.408248,r*-0.816497);
	glNormal3f(0.408248,0.816497,-0.408248);
	glVertex3f(r*0.408248,r*0.816497,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0.707107,0);
	glVertex3f(r*0.707107,r*0.707107,r*0);
	glNormal3f(0.816497,0.408248,-0.408248);
	glVertex3f(r*0.816497,r*0.408248,r*-0.408248);
	glNormal3f(0.408248,0.816497,-0.408248);
	glVertex3f(r*0.408248,r*0.816497,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0,r*-0.707107);
	glNormal3f(0.408248,0.408248,-0.816497);
	glVertex3f(r*0.408248,r*0.408248,r*-0.816497);
	glNormal3f(0.816497,0.408248,-0.408248);
	glVertex3f(r*0.816497,r*0.408248,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0.707107,-0.707107);
	glVertex3f(r*0,r*0.707107,r*-0.707107);
	glNormal3f(0.408248,0.816497,-0.408248);
	glVertex3f(r*0.408248,r*0.816497,r*-0.408248);
	glNormal3f(0.408248,0.408248,-0.816497);
	glVertex3f(r*0.408248,r*0.408248,r*-0.816497);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.382683,0.92388,0);
	glVertex3f(r*0.382683,r*0.92388,r*0);
	glNormal3f(0.408248,0.816497,-0.408248);
	glVertex3f(r*0.408248,r*0.816497,r*-0.408248);
	glNormal3f(0,0.92388,-0.382683);
	glVertex3f(r*0,r*0.92388,r*-0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,1,0);
	glVertex3f(r*0,r*1,r*0);
	glNormal3f(0.382683,0.92388,0);
	glVertex3f(r*0.382683,r*0.92388,r*0);
	glNormal3f(0,0.92388,-0.382683);
	glVertex3f(r*0,r*0.92388,r*-0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0.707107,0);
	glVertex3f(r*0.707107,r*0.707107,r*0);
	glNormal3f(0.408248,0.816497,-0.408248);
	glVertex3f(r*0.408248,r*0.816497,r*-0.408248);
	glNormal3f(0.382683,0.92388,0);
	glVertex3f(r*0.382683,r*0.92388,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0.707107,-0.707107);
	glVertex3f(r*0,r*0.707107,r*-0.707107);
	glNormal3f(0,0.92388,-0.382683);
	glVertex3f(r*0,r*0.92388,r*-0.382683);
	glNormal3f(0.408248,0.816497,-0.408248);
	glVertex3f(r*0.408248,r*0.816497,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.92388,0,-0.382683);
	glVertex3f(r*0.92388,r*0,r*-0.382683);
	glNormal3f(0.816497,0.408248,-0.408248);
	glVertex3f(r*0.816497,r*0.408248,r*-0.408248);
	glNormal3f(0.92388,0.382683,0);
	glVertex3f(r*0.92388,r*0.382683,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0,r*0);
	glNormal3f(0.92388,0,-0.382683);
	glVertex3f(r*0.92388,r*0,r*-0.382683);
	glNormal3f(0.92388,0.382683,0);
	glVertex3f(r*0.92388,r*0.382683,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0,r*-0.707107);
	glNormal3f(0.816497,0.408248,-0.408248);
	glVertex3f(r*0.816497,r*0.408248,r*-0.408248);
	glNormal3f(0.92388,0,-0.382683);
	glVertex3f(r*0.92388,r*0,r*-0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0.707107,0);
	glVertex3f(r*0.707107,r*0.707107,r*0);
	glNormal3f(0.92388,0.382683,0);
	glVertex3f(r*0.92388,r*0.382683,r*0);
	glNormal3f(0.816497,0.408248,-0.408248);
	glVertex3f(r*0.816497,r*0.408248,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0.382683,-0.92388);
	glVertex3f(r*0,r*0.382683,r*-0.92388);
	glNormal3f(0.408248,0.408248,-0.816497);
	glVertex3f(r*0.408248,r*0.408248,r*-0.816497);
	glNormal3f(0.382683,0,-0.92388);
	glVertex3f(r*0.382683,r*0,r*-0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0,r*-1);
	glNormal3f(0,0.382683,-0.92388);
	glVertex3f(r*0,r*0.382683,r*-0.92388);
	glNormal3f(0.382683,0,-0.92388);
	glVertex3f(r*0.382683,r*0,r*-0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0.707107,-0.707107);
	glVertex3f(r*0,r*0.707107,r*-0.707107);
	glNormal3f(0.408248,0.408248,-0.816497);
	glVertex3f(r*0.408248,r*0.408248,r*-0.816497);
	glNormal3f(0,0.382683,-0.92388);
	glVertex3f(r*0,r*0.382683,r*-0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0,r*-0.707107);
	glNormal3f(0.382683,0,-0.92388);
	glVertex3f(r*0.382683,r*0,r*-0.92388);
	glNormal3f(0.408248,0.408248,-0.816497);
	glVertex3f(r*0.408248,r*0.408248,r*-0.816497);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.408248,0.408248,-0.816497);
	glVertex3f(r*-0.408248,r*0.408248,r*-0.816497);
	glNormal3f(-0.816497,0.408248,-0.408248);
	glVertex3f(r*-0.816497,r*0.408248,r*-0.408248);
	glNormal3f(-0.408248,0.816497,-0.408248);
	glVertex3f(r*-0.408248,r*0.816497,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0.707107,-0.707107);
	glVertex3f(r*0,r*0.707107,r*-0.707107);
	glNormal3f(-0.408248,0.408248,-0.816497);
	glVertex3f(r*-0.408248,r*0.408248,r*-0.816497);
	glNormal3f(-0.408248,0.816497,-0.408248);
	glVertex3f(r*-0.408248,r*0.816497,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0,r*-0.707107);
	glNormal3f(-0.816497,0.408248,-0.408248);
	glVertex3f(r*-0.816497,r*0.408248,r*-0.408248);
	glNormal3f(-0.408248,0.408248,-0.816497);
	glVertex3f(r*-0.408248,r*0.408248,r*-0.816497);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0.707107,0);
	glVertex3f(r*-0.707107,r*0.707107,r*0);
	glNormal3f(-0.408248,0.816497,-0.408248);
	glVertex3f(r*-0.408248,r*0.816497,r*-0.408248);
	glNormal3f(-0.816497,0.408248,-0.408248);
	glVertex3f(r*-0.816497,r*0.408248,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0.92388,-0.382683);
	glVertex3f(r*0,r*0.92388,r*-0.382683);
	glNormal3f(-0.408248,0.816497,-0.408248);
	glVertex3f(r*-0.408248,r*0.816497,r*-0.408248);
	glNormal3f(-0.382683,0.92388,0);
	glVertex3f(r*-0.382683,r*0.92388,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,1,0);
	glVertex3f(r*0,r*1,r*0);
	glNormal3f(0,0.92388,-0.382683);
	glVertex3f(r*0,r*0.92388,r*-0.382683);
	glNormal3f(-0.382683,0.92388,0);
	glVertex3f(r*-0.382683,r*0.92388,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0.707107,-0.707107);
	glVertex3f(r*0,r*0.707107,r*-0.707107);
	glNormal3f(-0.408248,0.816497,-0.408248);
	glVertex3f(r*-0.408248,r*0.816497,r*-0.408248);
	glNormal3f(0,0.92388,-0.382683);
	glVertex3f(r*0,r*0.92388,r*-0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0.707107,0);
	glVertex3f(r*-0.707107,r*0.707107,r*0);
	glNormal3f(-0.382683,0.92388,0);
	glVertex3f(r*-0.382683,r*0.92388,r*0);
	glNormal3f(-0.408248,0.816497,-0.408248);
	glVertex3f(r*-0.408248,r*0.816497,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.382683,0,-0.92388);
	glVertex3f(r*-0.382683,r*0,r*-0.92388);
	glNormal3f(-0.408248,0.408248,-0.816497);
	glVertex3f(r*-0.408248,r*0.408248,r*-0.816497);
	glNormal3f(0,0.382683,-0.92388);
	glVertex3f(r*0,r*0.382683,r*-0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0,r*-1);
	glNormal3f(-0.382683,0,-0.92388);
	glVertex3f(r*-0.382683,r*0,r*-0.92388);
	glNormal3f(0,0.382683,-0.92388);
	glVertex3f(r*0,r*0.382683,r*-0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0,r*-0.707107);
	glNormal3f(-0.408248,0.408248,-0.816497);
	glVertex3f(r*-0.408248,r*0.408248,r*-0.816497);
	glNormal3f(-0.382683,0,-0.92388);
	glVertex3f(r*-0.382683,r*0,r*-0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0.707107,-0.707107);
	glVertex3f(r*0,r*0.707107,r*-0.707107);
	glNormal3f(0,0.382683,-0.92388);
	glVertex3f(r*0,r*0.382683,r*-0.92388);
	glNormal3f(-0.408248,0.408248,-0.816497);
	glVertex3f(r*-0.408248,r*0.408248,r*-0.816497);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.92388,0.382683,0);
	glVertex3f(r*-0.92388,r*0.382683,r*0);
	glNormal3f(-0.816497,0.408248,-0.408248);
	glVertex3f(r*-0.816497,r*0.408248,r*-0.408248);
	glNormal3f(-0.92388,0,-0.382683);
	glVertex3f(r*-0.92388,r*0,r*-0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0,r*0);
	glNormal3f(-0.92388,0.382683,0);
	glVertex3f(r*-0.92388,r*0.382683,r*0);
	glNormal3f(-0.92388,0,-0.382683);
	glVertex3f(r*-0.92388,r*0,r*-0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0.707107,0);
	glVertex3f(r*-0.707107,r*0.707107,r*0);
	glNormal3f(-0.816497,0.408248,-0.408248);
	glVertex3f(r*-0.816497,r*0.408248,r*-0.408248);
	glNormal3f(-0.92388,0.382683,0);
	glVertex3f(r*-0.92388,r*0.382683,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0,r*-0.707107);
	glNormal3f(-0.92388,0,-0.382683);
	glVertex3f(r*-0.92388,r*0,r*-0.382683);
	glNormal3f(-0.816497,0.408248,-0.408248);
	glVertex3f(r*-0.816497,r*0.408248,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.816497,0.408248,0.408248);
	glVertex3f(r*-0.816497,r*0.408248,r*0.408248);
	glNormal3f(-0.408248,0.408248,0.816497);
	glVertex3f(r*-0.408248,r*0.408248,r*0.816497);
	glNormal3f(-0.408248,0.816497,0.408248);
	glVertex3f(r*-0.408248,r*0.816497,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0.707107,0);
	glVertex3f(r*-0.707107,r*0.707107,r*0);
	glNormal3f(-0.816497,0.408248,0.408248);
	glVertex3f(r*-0.816497,r*0.408248,r*0.408248);
	glNormal3f(-0.408248,0.816497,0.408248);
	glVertex3f(r*-0.408248,r*0.816497,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0,r*0.707107);
	glNormal3f(-0.408248,0.408248,0.816497);
	glVertex3f(r*-0.408248,r*0.408248,r*0.816497);
	glNormal3f(-0.816497,0.408248,0.408248);
	glVertex3f(r*-0.816497,r*0.408248,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0.707107,0.707107);
	glVertex3f(r*0,r*0.707107,r*0.707107);
	glNormal3f(-0.408248,0.816497,0.408248);
	glVertex3f(r*-0.408248,r*0.816497,r*0.408248);
	glNormal3f(-0.408248,0.408248,0.816497);
	glVertex3f(r*-0.408248,r*0.408248,r*0.816497);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.382683,0.92388,0);
	glVertex3f(r*-0.382683,r*0.92388,r*0);
	glNormal3f(-0.408248,0.816497,0.408248);
	glVertex3f(r*-0.408248,r*0.816497,r*0.408248);
	glNormal3f(0,0.92388,0.382683);
	glVertex3f(r*0,r*0.92388,r*0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,1,0);
	glVertex3f(r*0,r*1,r*0);
	glNormal3f(-0.382683,0.92388,0);
	glVertex3f(r*-0.382683,r*0.92388,r*0);
	glNormal3f(0,0.92388,0.382683);
	glVertex3f(r*0,r*0.92388,r*0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0.707107,0);
	glVertex3f(r*-0.707107,r*0.707107,r*0);
	glNormal3f(-0.408248,0.816497,0.408248);
	glVertex3f(r*-0.408248,r*0.816497,r*0.408248);
	glNormal3f(-0.382683,0.92388,0);
	glVertex3f(r*-0.382683,r*0.92388,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0.707107,0.707107);
	glVertex3f(r*0,r*0.707107,r*0.707107);
	glNormal3f(0,0.92388,0.382683);
	glVertex3f(r*0,r*0.92388,r*0.382683);
	glNormal3f(-0.408248,0.816497,0.408248);
	glVertex3f(r*-0.408248,r*0.816497,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.92388,0,0.382683);
	glVertex3f(r*-0.92388,r*0,r*0.382683);
	glNormal3f(-0.816497,0.408248,0.408248);
	glVertex3f(r*-0.816497,r*0.408248,r*0.408248);
	glNormal3f(-0.92388,0.382683,0);
	glVertex3f(r*-0.92388,r*0.382683,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0,r*0);
	glNormal3f(-0.92388,0,0.382683);
	glVertex3f(r*-0.92388,r*0,r*0.382683);
	glNormal3f(-0.92388,0.382683,0);
	glVertex3f(r*-0.92388,r*0.382683,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0,r*0.707107);
	glNormal3f(-0.816497,0.408248,0.408248);
	glVertex3f(r*-0.816497,r*0.408248,r*0.408248);
	glNormal3f(-0.92388,0,0.382683);
	glVertex3f(r*-0.92388,r*0,r*0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0.707107,0);
	glVertex3f(r*-0.707107,r*0.707107,r*0);
	glNormal3f(-0.92388,0.382683,0);
	glVertex3f(r*-0.92388,r*0.382683,r*0);
	glNormal3f(-0.816497,0.408248,0.408248);
	glVertex3f(r*-0.816497,r*0.408248,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0.382683,0.92388);
	glVertex3f(r*0,r*0.382683,r*0.92388);
	glNormal3f(-0.408248,0.408248,0.816497);
	glVertex3f(r*-0.408248,r*0.408248,r*0.816497);
	glNormal3f(-0.382683,0,0.92388);
	glVertex3f(r*-0.382683,r*0,r*0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0,r*1);
	glNormal3f(0,0.382683,0.92388);
	glVertex3f(r*0,r*0.382683,r*0.92388);
	glNormal3f(-0.382683,0,0.92388);
	glVertex3f(r*-0.382683,r*0,r*0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0.707107,0.707107);
	glVertex3f(r*0,r*0.707107,r*0.707107);
	glNormal3f(-0.408248,0.408248,0.816497);
	glVertex3f(r*-0.408248,r*0.408248,r*0.816497);
	glNormal3f(0,0.382683,0.92388);
	glVertex3f(r*0,r*0.382683,r*0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0,r*0.707107);
	glNormal3f(-0.382683,0,0.92388);
	glVertex3f(r*-0.382683,r*0,r*0.92388);
	glNormal3f(-0.408248,0.408248,0.816497);
	glVertex3f(r*-0.408248,r*0.408248,r*0.816497);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.816497,-0.408248,0.408248);
	glVertex3f(r*0.816497,r*-0.408248,r*0.408248);
	glNormal3f(0.408248,-0.408248,0.816497);
	glVertex3f(r*0.408248,r*-0.408248,r*0.816497);
	glNormal3f(0.408248,-0.816497,0.408248);
	glVertex3f(r*0.408248,r*-0.816497,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,-0.707107,0);
	glVertex3f(r*0.707107,r*-0.707107,r*0);
	glNormal3f(0.816497,-0.408248,0.408248);
	glVertex3f(r*0.816497,r*-0.408248,r*0.408248);
	glNormal3f(0.408248,-0.816497,0.408248);
	glVertex3f(r*0.408248,r*-0.816497,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0,r*0.707107);
	glNormal3f(0.408248,-0.408248,0.816497);
	glVertex3f(r*0.408248,r*-0.408248,r*0.816497);
	glNormal3f(0.816497,-0.408248,0.408248);
	glVertex3f(r*0.816497,r*-0.408248,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-0.707107,0.707107);
	glVertex3f(r*0,r*-0.707107,r*0.707107);
	glNormal3f(0.408248,-0.816497,0.408248);
	glVertex3f(r*0.408248,r*-0.816497,r*0.408248);
	glNormal3f(0.408248,-0.408248,0.816497);
	glVertex3f(r*0.408248,r*-0.408248,r*0.816497);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.382683,-0.92388,0);
	glVertex3f(r*0.382683,r*-0.92388,r*0);
	glNormal3f(0.408248,-0.816497,0.408248);
	glVertex3f(r*0.408248,r*-0.816497,r*0.408248);
	glNormal3f(0,-0.92388,0.382683);
	glVertex3f(r*0,r*-0.92388,r*0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-1,0);
	glVertex3f(r*0,r*-1,r*0);
	glNormal3f(0.382683,-0.92388,0);
	glVertex3f(r*0.382683,r*-0.92388,r*0);
	glNormal3f(0,-0.92388,0.382683);
	glVertex3f(r*0,r*-0.92388,r*0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,-0.707107,0);
	glVertex3f(r*0.707107,r*-0.707107,r*0);
	glNormal3f(0.408248,-0.816497,0.408248);
	glVertex3f(r*0.408248,r*-0.816497,r*0.408248);
	glNormal3f(0.382683,-0.92388,0);
	glVertex3f(r*0.382683,r*-0.92388,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-0.707107,0.707107);
	glVertex3f(r*0,r*-0.707107,r*0.707107);
	glNormal3f(0,-0.92388,0.382683);
	glVertex3f(r*0,r*-0.92388,r*0.382683);
	glNormal3f(0.408248,-0.816497,0.408248);
	glVertex3f(r*0.408248,r*-0.816497,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.92388,0,0.382683);
	glVertex3f(r*0.92388,r*0,r*0.382683);
	glNormal3f(0.816497,-0.408248,0.408248);
	glVertex3f(r*0.816497,r*-0.408248,r*0.408248);
	glNormal3f(0.92388,-0.382683,0);
	glVertex3f(r*0.92388,r*-0.382683,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0,r*0);
	glNormal3f(0.92388,0,0.382683);
	glVertex3f(r*0.92388,r*0,r*0.382683);
	glNormal3f(0.92388,-0.382683,0);
	glVertex3f(r*0.92388,r*-0.382683,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0,r*0.707107);
	glNormal3f(0.816497,-0.408248,0.408248);
	glVertex3f(r*0.816497,r*-0.408248,r*0.408248);
	glNormal3f(0.92388,0,0.382683);
	glVertex3f(r*0.92388,r*0,r*0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,-0.707107,0);
	glVertex3f(r*0.707107,r*-0.707107,r*0);
	glNormal3f(0.92388,-0.382683,0);
	glVertex3f(r*0.92388,r*-0.382683,r*0);
	glNormal3f(0.816497,-0.408248,0.408248);
	glVertex3f(r*0.816497,r*-0.408248,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-0.382683,0.92388);
	glVertex3f(r*0,r*-0.382683,r*0.92388);
	glNormal3f(0.408248,-0.408248,0.816497);
	glVertex3f(r*0.408248,r*-0.408248,r*0.816497);
	glNormal3f(0.382683,0,0.92388);
	glVertex3f(r*0.382683,r*0,r*0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0,r*1);
	glNormal3f(0,-0.382683,0.92388);
	glVertex3f(r*0,r*-0.382683,r*0.92388);
	glNormal3f(0.382683,0,0.92388);
	glVertex3f(r*0.382683,r*0,r*0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-0.707107,0.707107);
	glVertex3f(r*0,r*-0.707107,r*0.707107);
	glNormal3f(0.408248,-0.408248,0.816497);
	glVertex3f(r*0.408248,r*-0.408248,r*0.816497);
	glNormal3f(0,-0.382683,0.92388);
	glVertex3f(r*0,r*-0.382683,r*0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0,r*0.707107);
	glNormal3f(0.382683,0,0.92388);
	glVertex3f(r*0.382683,r*0,r*0.92388);
	glNormal3f(0.408248,-0.408248,0.816497);
	glVertex3f(r*0.408248,r*-0.408248,r*0.816497);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.408248,-0.408248,-0.816497);
	glVertex3f(r*0.408248,r*-0.408248,r*-0.816497);
	glNormal3f(0.816497,-0.408248,-0.408248);
	glVertex3f(r*0.816497,r*-0.408248,r*-0.408248);
	glNormal3f(0.408248,-0.816497,-0.408248);
	glVertex3f(r*0.408248,r*-0.816497,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-0.707107,-0.707107);
	glVertex3f(r*0,r*-0.707107,r*-0.707107);
	glNormal3f(0.408248,-0.408248,-0.816497);
	glVertex3f(r*0.408248,r*-0.408248,r*-0.816497);
	glNormal3f(0.408248,-0.816497,-0.408248);
	glVertex3f(r*0.408248,r*-0.816497,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0,r*-0.707107);
	glNormal3f(0.816497,-0.408248,-0.408248);
	glVertex3f(r*0.816497,r*-0.408248,r*-0.408248);
	glNormal3f(0.408248,-0.408248,-0.816497);
	glVertex3f(r*0.408248,r*-0.408248,r*-0.816497);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,-0.707107,0);
	glVertex3f(r*0.707107,r*-0.707107,r*0);
	glNormal3f(0.408248,-0.816497,-0.408248);
	glVertex3f(r*0.408248,r*-0.816497,r*-0.408248);
	glNormal3f(0.816497,-0.408248,-0.408248);
	glVertex3f(r*0.816497,r*-0.408248,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-0.92388,-0.382683);
	glVertex3f(r*0,r*-0.92388,r*-0.382683);
	glNormal3f(0.408248,-0.816497,-0.408248);
	glVertex3f(r*0.408248,r*-0.816497,r*-0.408248);
	glNormal3f(0.382683,-0.92388,0);
	glVertex3f(r*0.382683,r*-0.92388,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-1,0);
	glVertex3f(r*0,r*-1,r*0);
	glNormal3f(0,-0.92388,-0.382683);
	glVertex3f(r*0,r*-0.92388,r*-0.382683);
	glNormal3f(0.382683,-0.92388,0);
	glVertex3f(r*0.382683,r*-0.92388,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-0.707107,-0.707107);
	glVertex3f(r*0,r*-0.707107,r*-0.707107);
	glNormal3f(0.408248,-0.816497,-0.408248);
	glVertex3f(r*0.408248,r*-0.816497,r*-0.408248);
	glNormal3f(0,-0.92388,-0.382683);
	glVertex3f(r*0,r*-0.92388,r*-0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,-0.707107,0);
	glVertex3f(r*0.707107,r*-0.707107,r*0);
	glNormal3f(0.382683,-0.92388,0);
	glVertex3f(r*0.382683,r*-0.92388,r*0);
	glNormal3f(0.408248,-0.816497,-0.408248);
	glVertex3f(r*0.408248,r*-0.816497,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.382683,0,-0.92388);
	glVertex3f(r*0.382683,r*0,r*-0.92388);
	glNormal3f(0.408248,-0.408248,-0.816497);
	glVertex3f(r*0.408248,r*-0.408248,r*-0.816497);
	glNormal3f(0,-0.382683,-0.92388);
	glVertex3f(r*0,r*-0.382683,r*-0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0,r*-1);
	glNormal3f(0.382683,0,-0.92388);
	glVertex3f(r*0.382683,r*0,r*-0.92388);
	glNormal3f(0,-0.382683,-0.92388);
	glVertex3f(r*0,r*-0.382683,r*-0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0,r*-0.707107);
	glNormal3f(0.408248,-0.408248,-0.816497);
	glVertex3f(r*0.408248,r*-0.408248,r*-0.816497);
	glNormal3f(0.382683,0,-0.92388);
	glVertex3f(r*0.382683,r*0,r*-0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-0.707107,-0.707107);
	glVertex3f(r*0,r*-0.707107,r*-0.707107);
	glNormal3f(0,-0.382683,-0.92388);
	glVertex3f(r*0,r*-0.382683,r*-0.92388);
	glNormal3f(0.408248,-0.408248,-0.816497);
	glVertex3f(r*0.408248,r*-0.408248,r*-0.816497);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.92388,-0.382683,0);
	glVertex3f(r*0.92388,r*-0.382683,r*0);
	glNormal3f(0.816497,-0.408248,-0.408248);
	glVertex3f(r*0.816497,r*-0.408248,r*-0.408248);
	glNormal3f(0.92388,0,-0.382683);
	glVertex3f(r*0.92388,r*0,r*-0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0,r*0);
	glNormal3f(0.92388,-0.382683,0);
	glVertex3f(r*0.92388,r*-0.382683,r*0);
	glNormal3f(0.92388,0,-0.382683);
	glVertex3f(r*0.92388,r*0,r*-0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,-0.707107,0);
	glVertex3f(r*0.707107,r*-0.707107,r*0);
	glNormal3f(0.816497,-0.408248,-0.408248);
	glVertex3f(r*0.816497,r*-0.408248,r*-0.408248);
	glNormal3f(0.92388,-0.382683,0);
	glVertex3f(r*0.92388,r*-0.382683,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0,r*-0.707107);
	glNormal3f(0.92388,0,-0.382683);
	glVertex3f(r*0.92388,r*0,r*-0.382683);
	glNormal3f(0.816497,-0.408248,-0.408248);
	glVertex3f(r*0.816497,r*-0.408248,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.816497,-0.408248,-0.408248);
	glVertex3f(r*-0.816497,r*-0.408248,r*-0.408248);
	glNormal3f(-0.408248,-0.408248,-0.816497);
	glVertex3f(r*-0.408248,r*-0.408248,r*-0.816497);
	glNormal3f(-0.408248,-0.816497,-0.408248);
	glVertex3f(r*-0.408248,r*-0.816497,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,-0.707107,0);
	glVertex3f(r*-0.707107,r*-0.707107,r*0);
	glNormal3f(-0.816497,-0.408248,-0.408248);
	glVertex3f(r*-0.816497,r*-0.408248,r*-0.408248);
	glNormal3f(-0.408248,-0.816497,-0.408248);
	glVertex3f(r*-0.408248,r*-0.816497,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0,r*-0.707107);
	glNormal3f(-0.408248,-0.408248,-0.816497);
	glVertex3f(r*-0.408248,r*-0.408248,r*-0.816497);
	glNormal3f(-0.816497,-0.408248,-0.408248);
	glVertex3f(r*-0.816497,r*-0.408248,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-0.707107,-0.707107);
	glVertex3f(r*0,r*-0.707107,r*-0.707107);
	glNormal3f(-0.408248,-0.816497,-0.408248);
	glVertex3f(r*-0.408248,r*-0.816497,r*-0.408248);
	glNormal3f(-0.408248,-0.408248,-0.816497);
	glVertex3f(r*-0.408248,r*-0.408248,r*-0.816497);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.382683,-0.92388,0);
	glVertex3f(r*-0.382683,r*-0.92388,r*0);
	glNormal3f(-0.408248,-0.816497,-0.408248);
	glVertex3f(r*-0.408248,r*-0.816497,r*-0.408248);
	glNormal3f(0,-0.92388,-0.382683);
	glVertex3f(r*0,r*-0.92388,r*-0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-1,0);
	glVertex3f(r*0,r*-1,r*0);
	glNormal3f(-0.382683,-0.92388,0);
	glVertex3f(r*-0.382683,r*-0.92388,r*0);
	glNormal3f(0,-0.92388,-0.382683);
	glVertex3f(r*0,r*-0.92388,r*-0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,-0.707107,0);
	glVertex3f(r*-0.707107,r*-0.707107,r*0);
	glNormal3f(-0.408248,-0.816497,-0.408248);
	glVertex3f(r*-0.408248,r*-0.816497,r*-0.408248);
	glNormal3f(-0.382683,-0.92388,0);
	glVertex3f(r*-0.382683,r*-0.92388,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-0.707107,-0.707107);
	glVertex3f(r*0,r*-0.707107,r*-0.707107);
	glNormal3f(0,-0.92388,-0.382683);
	glVertex3f(r*0,r*-0.92388,r*-0.382683);
	glNormal3f(-0.408248,-0.816497,-0.408248);
	glVertex3f(r*-0.408248,r*-0.816497,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.92388,0,-0.382683);
	glVertex3f(r*-0.92388,r*0,r*-0.382683);
	glNormal3f(-0.816497,-0.408248,-0.408248);
	glVertex3f(r*-0.816497,r*-0.408248,r*-0.408248);
	glNormal3f(-0.92388,-0.382683,0);
	glVertex3f(r*-0.92388,r*-0.382683,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0,r*0);
	glNormal3f(-0.92388,0,-0.382683);
	glVertex3f(r*-0.92388,r*0,r*-0.382683);
	glNormal3f(-0.92388,-0.382683,0);
	glVertex3f(r*-0.92388,r*-0.382683,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0,r*-0.707107);
	glNormal3f(-0.816497,-0.408248,-0.408248);
	glVertex3f(r*-0.816497,r*-0.408248,r*-0.408248);
	glNormal3f(-0.92388,0,-0.382683);
	glVertex3f(r*-0.92388,r*0,r*-0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,-0.707107,0);
	glVertex3f(r*-0.707107,r*-0.707107,r*0);
	glNormal3f(-0.92388,-0.382683,0);
	glVertex3f(r*-0.92388,r*-0.382683,r*0);
	glNormal3f(-0.816497,-0.408248,-0.408248);
	glVertex3f(r*-0.816497,r*-0.408248,r*-0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-0.382683,-0.92388);
	glVertex3f(r*0,r*-0.382683,r*-0.92388);
	glNormal3f(-0.408248,-0.408248,-0.816497);
	glVertex3f(r*-0.408248,r*-0.408248,r*-0.816497);
	glNormal3f(-0.382683,0,-0.92388);
	glVertex3f(r*-0.382683,r*0,r*-0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0,r*-1);
	glNormal3f(0,-0.382683,-0.92388);
	glVertex3f(r*0,r*-0.382683,r*-0.92388);
	glNormal3f(-0.382683,0,-0.92388);
	glVertex3f(r*-0.382683,r*0,r*-0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-0.707107,-0.707107);
	glVertex3f(r*0,r*-0.707107,r*-0.707107);
	glNormal3f(-0.408248,-0.408248,-0.816497);
	glVertex3f(r*-0.408248,r*-0.408248,r*-0.816497);
	glNormal3f(0,-0.382683,-0.92388);
	glVertex3f(r*0,r*-0.382683,r*-0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0,r*-0.707107);
	glNormal3f(-0.382683,0,-0.92388);
	glVertex3f(r*-0.382683,r*0,r*-0.92388);
	glNormal3f(-0.408248,-0.408248,-0.816497);
	glVertex3f(r*-0.408248,r*-0.408248,r*-0.816497);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.408248,-0.408248,0.816497);
	glVertex3f(r*-0.408248,r*-0.408248,r*0.816497);
	glNormal3f(-0.816497,-0.408248,0.408248);
	glVertex3f(r*-0.816497,r*-0.408248,r*0.408248);
	glNormal3f(-0.408248,-0.816497,0.408248);
	glVertex3f(r*-0.408248,r*-0.816497,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-0.707107,0.707107);
	glVertex3f(r*0,r*-0.707107,r*0.707107);
	glNormal3f(-0.408248,-0.408248,0.816497);
	glVertex3f(r*-0.408248,r*-0.408248,r*0.816497);
	glNormal3f(-0.408248,-0.816497,0.408248);
	glVertex3f(r*-0.408248,r*-0.816497,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0,r*0.707107);
	glNormal3f(-0.816497,-0.408248,0.408248);
	glVertex3f(r*-0.816497,r*-0.408248,r*0.408248);
	glNormal3f(-0.408248,-0.408248,0.816497);
	glVertex3f(r*-0.408248,r*-0.408248,r*0.816497);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,-0.707107,0);
	glVertex3f(r*-0.707107,r*-0.707107,r*0);
	glNormal3f(-0.408248,-0.816497,0.408248);
	glVertex3f(r*-0.408248,r*-0.816497,r*0.408248);
	glNormal3f(-0.816497,-0.408248,0.408248);
	glVertex3f(r*-0.816497,r*-0.408248,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-0.92388,0.382683);
	glVertex3f(r*0,r*-0.92388,r*0.382683);
	glNormal3f(-0.408248,-0.816497,0.408248);
	glVertex3f(r*-0.408248,r*-0.816497,r*0.408248);
	glNormal3f(-0.382683,-0.92388,0);
	glVertex3f(r*-0.382683,r*-0.92388,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-1,0);
	glVertex3f(r*0,r*-1,r*0);
	glNormal3f(0,-0.92388,0.382683);
	glVertex3f(r*0,r*-0.92388,r*0.382683);
	glNormal3f(-0.382683,-0.92388,0);
	glVertex3f(r*-0.382683,r*-0.92388,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-0.707107,0.707107);
	glVertex3f(r*0,r*-0.707107,r*0.707107);
	glNormal3f(-0.408248,-0.816497,0.408248);
	glVertex3f(r*-0.408248,r*-0.816497,r*0.408248);
	glNormal3f(0,-0.92388,0.382683);
	glVertex3f(r*0,r*-0.92388,r*0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,-0.707107,0);
	glVertex3f(r*-0.707107,r*-0.707107,r*0);
	glNormal3f(-0.382683,-0.92388,0);
	glVertex3f(r*-0.382683,r*-0.92388,r*0);
	glNormal3f(-0.408248,-0.816497,0.408248);
	glVertex3f(r*-0.408248,r*-0.816497,r*0.408248);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.382683,0,0.92388);
	glVertex3f(r*-0.382683,r*0,r*0.92388);
	glNormal3f(-0.408248,-0.408248,0.816497);
	glVertex3f(r*-0.408248,r*-0.408248,r*0.816497);
	glNormal3f(0,-0.382683,0.92388);
	glVertex3f(r*0,r*-0.382683,r*0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0,r*1);
	glNormal3f(-0.382683,0,0.92388);
	glVertex3f(r*-0.382683,r*0,r*0.92388);
	glNormal3f(0,-0.382683,0.92388);
	glVertex3f(r*0,r*-0.382683,r*0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0,r*0.707107);
	glNormal3f(-0.408248,-0.408248,0.816497);
	glVertex3f(r*-0.408248,r*-0.408248,r*0.816497);
	glNormal3f(-0.382683,0,0.92388);
	glVertex3f(r*-0.382683,r*0,r*0.92388);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,-0.707107,0.707107);
	glVertex3f(r*0,r*-0.707107,r*0.707107);
	glNormal3f(0,-0.382683,0.92388);
	glVertex3f(r*0,r*-0.382683,r*0.92388);
	glNormal3f(-0.408248,-0.408248,0.816497);
	glVertex3f(r*-0.408248,r*-0.408248,r*0.816497);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.92388,-0.382683,0);
	glVertex3f(r*-0.92388,r*-0.382683,r*0);
	glNormal3f(-0.816497,-0.408248,0.408248);
	glVertex3f(r*-0.816497,r*-0.408248,r*0.408248);
	glNormal3f(-0.92388,0,0.382683);
	glVertex3f(r*-0.92388,r*0,r*0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0,r*0);
	glNormal3f(-0.92388,-0.382683,0);
	glVertex3f(r*-0.92388,r*-0.382683,r*0);
	glNormal3f(-0.92388,0,0.382683);
	glVertex3f(r*-0.92388,r*0,r*0.382683);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,-0.707107,0);
	glVertex3f(r*-0.707107,r*-0.707107,r*0);
	glNormal3f(-0.816497,-0.408248,0.408248);
	glVertex3f(r*-0.816497,r*-0.408248,r*0.408248);
	glNormal3f(-0.92388,-0.382683,0);
	glVertex3f(r*-0.92388,r*-0.382683,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0,r*0.707107);
	glNormal3f(-0.92388,0,0.382683);
	glVertex3f(r*-0.92388,r*0,r*0.382683);
	glNormal3f(-0.816497,-0.408248,0.408248);
	glVertex3f(r*-0.816497,r*-0.408248,r*0.408248);
	glEnd();
	glEnd();
	glPopMatrix(); 
}

void GLPrimitive::wire_sphere(float r, Material *mat, Matrix4f *t){
	glPushMatrix(); 
	float transform[16]; 
	t->get(transform); 
	glMultMatrixf(transform); 
	//SPHERE DIV 2
	//PARAM: r : ray

if(mat!=NULL){

	mat->gl();

}
	glVertex3f(r*0.408248,r*0.408248,r*0.816497);
	glVertex3f(r*0.816497,r*0.408248,r*0.408248);
	glVertex3f(r*0.408248,r*0.816497,r*0.408248);
	glVertex3f(r*0,r*0.707107,r*0.707107);
	glVertex3f(r*0.408248,r*0.408248,r*0.816497);
	glVertex3f(r*0.408248,r*0.816497,r*0.408248);
	glVertex3f(r*0.707107,r*0,r*0.707107);
	glVertex3f(r*0.816497,r*0.408248,r*0.408248);
	glVertex3f(r*0.408248,r*0.408248,r*0.816497);
	glVertex3f(r*0.707107,r*0.707107,r*0);
	glVertex3f(r*0.408248,r*0.816497,r*0.408248);
	glVertex3f(r*0.816497,r*0.408248,r*0.408248);
	glVertex3f(r*0,r*0.92388,r*0.382683);
	glVertex3f(r*0.408248,r*0.816497,r*0.408248);
	glVertex3f(r*0.382683,r*0.92388,r*0);
	glVertex3f(r*0,r*1,r*0);
	glVertex3f(r*0,r*0.92388,r*0.382683);
	glVertex3f(r*0.382683,r*0.92388,r*0);
	glVertex3f(r*0,r*0.707107,r*0.707107);
	glVertex3f(r*0.408248,r*0.816497,r*0.408248);
	glVertex3f(r*0,r*0.92388,r*0.382683);
	glVertex3f(r*0.707107,r*0.707107,r*0);
	glVertex3f(r*0.382683,r*0.92388,r*0);
	glVertex3f(r*0.408248,r*0.816497,r*0.408248);
	glVertex3f(r*0.382683,r*0,r*0.92388);
	glVertex3f(r*0.408248,r*0.408248,r*0.816497);
	glVertex3f(r*0,r*0.382683,r*0.92388);
	glVertex3f(r*0,r*0,r*1);
	glVertex3f(r*0.382683,r*0,r*0.92388);
	glVertex3f(r*0,r*0.382683,r*0.92388);
	glVertex3f(r*0.707107,r*0,r*0.707107);
	glVertex3f(r*0.408248,r*0.408248,r*0.816497);
	glVertex3f(r*0.382683,r*0,r*0.92388);
	glVertex3f(r*0,r*0.707107,r*0.707107);
	glVertex3f(r*0,r*0.382683,r*0.92388);
	glVertex3f(r*0.408248,r*0.408248,r*0.816497);
	glVertex3f(r*0.92388,r*0.382683,r*0);
	glVertex3f(r*0.816497,r*0.408248,r*0.408248);
	glVertex3f(r*0.92388,r*0,r*0.382683);
	glVertex3f(r*1,r*0,r*0);
	glVertex3f(r*0.92388,r*0.382683,r*0);
	glVertex3f(r*0.92388,r*0,r*0.382683);
	glVertex3f(r*0.707107,r*0.707107,r*0);
	glVertex3f(r*0.816497,r*0.408248,r*0.408248);
	glVertex3f(r*0.92388,r*0.382683,r*0);
	glVertex3f(r*0.707107,r*0,r*0.707107);
	glVertex3f(r*0.92388,r*0,r*0.382683);
	glVertex3f(r*0.816497,r*0.408248,r*0.408248);
	glVertex3f(r*0.816497,r*0.408248,r*-0.408248);
	glVertex3f(r*0.408248,r*0.408248,r*-0.816497);
	glVertex3f(r*0.408248,r*0.816497,r*-0.408248);
	glVertex3f(r*0.707107,r*0.707107,r*0);
	glVertex3f(r*0.816497,r*0.408248,r*-0.408248);
	glVertex3f(r*0.408248,r*0.816497,r*-0.408248);
	glVertex3f(r*0.707107,r*0,r*-0.707107);
	glVertex3f(r*0.408248,r*0.408248,r*-0.816497);
	glVertex3f(r*0.816497,r*0.408248,r*-0.408248);
	glVertex3f(r*0,r*0.707107,r*-0.707107);
	glVertex3f(r*0.408248,r*0.816497,r*-0.408248);
	glVertex3f(r*0.408248,r*0.408248,r*-0.816497);
	glVertex3f(r*0.382683,r*0.92388,r*0);
	glVertex3f(r*0.408248,r*0.816497,r*-0.408248);
	glVertex3f(r*0,r*0.92388,r*-0.382683);
	glVertex3f(r*0,r*1,r*0);
	glVertex3f(r*0.382683,r*0.92388,r*0);
	glVertex3f(r*0,r*0.92388,r*-0.382683);
	glVertex3f(r*0.707107,r*0.707107,r*0);
	glVertex3f(r*0.408248,r*0.816497,r*-0.408248);
	glVertex3f(r*0.382683,r*0.92388,r*0);
	glVertex3f(r*0,r*0.707107,r*-0.707107);
	glVertex3f(r*0,r*0.92388,r*-0.382683);
	glVertex3f(r*0.408248,r*0.816497,r*-0.408248);
	glVertex3f(r*0.92388,r*0,r*-0.382683);
	glVertex3f(r*0.816497,r*0.408248,r*-0.408248);
	glVertex3f(r*0.92388,r*0.382683,r*0);
	glVertex3f(r*1,r*0,r*0);
	glVertex3f(r*0.92388,r*0,r*-0.382683);
	glVertex3f(r*0.92388,r*0.382683,r*0);
	glVertex3f(r*0.707107,r*0,r*-0.707107);
	glVertex3f(r*0.816497,r*0.408248,r*-0.408248);
	glVertex3f(r*0.92388,r*0,r*-0.382683);
	glVertex3f(r*0.707107,r*0.707107,r*0);
	glVertex3f(r*0.92388,r*0.382683,r*0);
	glVertex3f(r*0.816497,r*0.408248,r*-0.408248);
	glVertex3f(r*0,r*0.382683,r*-0.92388);
	glVertex3f(r*0.408248,r*0.408248,r*-0.816497);
	glVertex3f(r*0.382683,r*0,r*-0.92388);
	glVertex3f(r*0,r*0,r*-1);
	glVertex3f(r*0,r*0.382683,r*-0.92388);
	glVertex3f(r*0.382683,r*0,r*-0.92388);
	glVertex3f(r*0,r*0.707107,r*-0.707107);
	glVertex3f(r*0.408248,r*0.408248,r*-0.816497);
	glVertex3f(r*0,r*0.382683,r*-0.92388);
	glVertex3f(r*0.707107,r*0,r*-0.707107);
	glVertex3f(r*0.382683,r*0,r*-0.92388);
	glVertex3f(r*0.408248,r*0.408248,r*-0.816497);
	glVertex3f(r*-0.408248,r*0.408248,r*-0.816497);
	glVertex3f(r*-0.816497,r*0.408248,r*-0.408248);
	glVertex3f(r*-0.408248,r*0.816497,r*-0.408248);
	glVertex3f(r*0,r*0.707107,r*-0.707107);
	glVertex3f(r*-0.408248,r*0.408248,r*-0.816497);
	glVertex3f(r*-0.408248,r*0.816497,r*-0.408248);
	glVertex3f(r*-0.707107,r*0,r*-0.707107);
	glVertex3f(r*-0.816497,r*0.408248,r*-0.408248);
	glVertex3f(r*-0.408248,r*0.408248,r*-0.816497);
	glVertex3f(r*-0.707107,r*0.707107,r*0);
	glVertex3f(r*-0.408248,r*0.816497,r*-0.408248);
	glVertex3f(r*-0.816497,r*0.408248,r*-0.408248);
	glVertex3f(r*0,r*0.92388,r*-0.382683);
	glVertex3f(r*-0.408248,r*0.816497,r*-0.408248);
	glVertex3f(r*-0.382683,r*0.92388,r*0);
	glVertex3f(r*0,r*1,r*0);
	glVertex3f(r*0,r*0.92388,r*-0.382683);
	glVertex3f(r*-0.382683,r*0.92388,r*0);
	glVertex3f(r*0,r*0.707107,r*-0.707107);
	glVertex3f(r*-0.408248,r*0.816497,r*-0.408248);
	glVertex3f(r*0,r*0.92388,r*-0.382683);
	glVertex3f(r*-0.707107,r*0.707107,r*0);
	glVertex3f(r*-0.382683,r*0.92388,r*0);
	glVertex3f(r*-0.408248,r*0.816497,r*-0.408248);
	glVertex3f(r*-0.382683,r*0,r*-0.92388);
	glVertex3f(r*-0.408248,r*0.408248,r*-0.816497);
	glVertex3f(r*0,r*0.382683,r*-0.92388);
	glVertex3f(r*0,r*0,r*-1);
	glVertex3f(r*-0.382683,r*0,r*-0.92388);
	glVertex3f(r*0,r*0.382683,r*-0.92388);
	glVertex3f(r*-0.707107,r*0,r*-0.707107);
	glVertex3f(r*-0.408248,r*0.408248,r*-0.816497);
	glVertex3f(r*-0.382683,r*0,r*-0.92388);
	glVertex3f(r*0,r*0.707107,r*-0.707107);
	glVertex3f(r*0,r*0.382683,r*-0.92388);
	glVertex3f(r*-0.408248,r*0.408248,r*-0.816497);
	glVertex3f(r*-0.92388,r*0.382683,r*0);
	glVertex3f(r*-0.816497,r*0.408248,r*-0.408248);
	glVertex3f(r*-0.92388,r*0,r*-0.382683);
	glVertex3f(r*-1,r*0,r*0);
	glVertex3f(r*-0.92388,r*0.382683,r*0);
	glVertex3f(r*-0.92388,r*0,r*-0.382683);
	glVertex3f(r*-0.707107,r*0.707107,r*0);
	glVertex3f(r*-0.816497,r*0.408248,r*-0.408248);
	glVertex3f(r*-0.92388,r*0.382683,r*0);
	glVertex3f(r*-0.707107,r*0,r*-0.707107);
	glVertex3f(r*-0.92388,r*0,r*-0.382683);
	glVertex3f(r*-0.816497,r*0.408248,r*-0.408248);
	glVertex3f(r*-0.816497,r*0.408248,r*0.408248);
	glVertex3f(r*-0.408248,r*0.408248,r*0.816497);
	glVertex3f(r*-0.408248,r*0.816497,r*0.408248);
	glVertex3f(r*-0.707107,r*0.707107,r*0);
	glVertex3f(r*-0.816497,r*0.408248,r*0.408248);
	glVertex3f(r*-0.408248,r*0.816497,r*0.408248);
	glVertex3f(r*-0.707107,r*0,r*0.707107);
	glVertex3f(r*-0.408248,r*0.408248,r*0.816497);
	glVertex3f(r*-0.816497,r*0.408248,r*0.408248);
	glVertex3f(r*0,r*0.707107,r*0.707107);
	glVertex3f(r*-0.408248,r*0.816497,r*0.408248);
	glVertex3f(r*-0.408248,r*0.408248,r*0.816497);
	glVertex3f(r*-0.382683,r*0.92388,r*0);
	glVertex3f(r*-0.408248,r*0.816497,r*0.408248);
	glVertex3f(r*0,r*0.92388,r*0.382683);
	glVertex3f(r*0,r*1,r*0);
	glVertex3f(r*-0.382683,r*0.92388,r*0);
	glVertex3f(r*0,r*0.92388,r*0.382683);
	glVertex3f(r*-0.707107,r*0.707107,r*0);
	glVertex3f(r*-0.408248,r*0.816497,r*0.408248);
	glVertex3f(r*-0.382683,r*0.92388,r*0);
	glVertex3f(r*0,r*0.707107,r*0.707107);
	glVertex3f(r*0,r*0.92388,r*0.382683);
	glVertex3f(r*-0.408248,r*0.816497,r*0.408248);
	glVertex3f(r*-0.92388,r*0,r*0.382683);
	glVertex3f(r*-0.816497,r*0.408248,r*0.408248);
	glVertex3f(r*-0.92388,r*0.382683,r*0);
	glVertex3f(r*-1,r*0,r*0);
	glVertex3f(r*-0.92388,r*0,r*0.382683);
	glVertex3f(r*-0.92388,r*0.382683,r*0);
	glVertex3f(r*-0.707107,r*0,r*0.707107);
	glVertex3f(r*-0.816497,r*0.408248,r*0.408248);
	glVertex3f(r*-0.92388,r*0,r*0.382683);
	glVertex3f(r*-0.707107,r*0.707107,r*0);
	glVertex3f(r*-0.92388,r*0.382683,r*0);
	glVertex3f(r*-0.816497,r*0.408248,r*0.408248);
	glVertex3f(r*0,r*0.382683,r*0.92388);
	glVertex3f(r*-0.408248,r*0.408248,r*0.816497);
	glVertex3f(r*-0.382683,r*0,r*0.92388);
	glVertex3f(r*0,r*0,r*1);
	glVertex3f(r*0,r*0.382683,r*0.92388);
	glVertex3f(r*-0.382683,r*0,r*0.92388);
	glVertex3f(r*0,r*0.707107,r*0.707107);
	glVertex3f(r*-0.408248,r*0.408248,r*0.816497);
	glVertex3f(r*0,r*0.382683,r*0.92388);
	glVertex3f(r*-0.707107,r*0,r*0.707107);
	glVertex3f(r*-0.382683,r*0,r*0.92388);
	glVertex3f(r*-0.408248,r*0.408248,r*0.816497);
	glVertex3f(r*0.816497,r*-0.408248,r*0.408248);
	glVertex3f(r*0.408248,r*-0.408248,r*0.816497);
	glVertex3f(r*0.408248,r*-0.816497,r*0.408248);
	glVertex3f(r*0.707107,r*-0.707107,r*0);
	glVertex3f(r*0.816497,r*-0.408248,r*0.408248);
	glVertex3f(r*0.408248,r*-0.816497,r*0.408248);
	glVertex3f(r*0.707107,r*0,r*0.707107);
	glVertex3f(r*0.408248,r*-0.408248,r*0.816497);
	glVertex3f(r*0.816497,r*-0.408248,r*0.408248);
	glVertex3f(r*0,r*-0.707107,r*0.707107);
	glVertex3f(r*0.408248,r*-0.816497,r*0.408248);
	glVertex3f(r*0.408248,r*-0.408248,r*0.816497);
	glVertex3f(r*0.382683,r*-0.92388,r*0);
	glVertex3f(r*0.408248,r*-0.816497,r*0.408248);
	glVertex3f(r*0,r*-0.92388,r*0.382683);
	glVertex3f(r*0,r*-1,r*0);
	glVertex3f(r*0.382683,r*-0.92388,r*0);
	glVertex3f(r*0,r*-0.92388,r*0.382683);
	glVertex3f(r*0.707107,r*-0.707107,r*0);
	glVertex3f(r*0.408248,r*-0.816497,r*0.408248);
	glVertex3f(r*0.382683,r*-0.92388,r*0);
	glVertex3f(r*0,r*-0.707107,r*0.707107);
	glVertex3f(r*0,r*-0.92388,r*0.382683);
	glVertex3f(r*0.408248,r*-0.816497,r*0.408248);
	glVertex3f(r*0.92388,r*0,r*0.382683);
	glVertex3f(r*0.816497,r*-0.408248,r*0.408248);
	glVertex3f(r*0.92388,r*-0.382683,r*0);
	glVertex3f(r*1,r*0,r*0);
	glVertex3f(r*0.92388,r*0,r*0.382683);
	glVertex3f(r*0.92388,r*-0.382683,r*0);
	glVertex3f(r*0.707107,r*0,r*0.707107);
	glVertex3f(r*0.816497,r*-0.408248,r*0.408248);
	glVertex3f(r*0.92388,r*0,r*0.382683);
	glVertex3f(r*0.707107,r*-0.707107,r*0);
	glVertex3f(r*0.92388,r*-0.382683,r*0);
	glVertex3f(r*0.816497,r*-0.408248,r*0.408248);
	glVertex3f(r*0,r*-0.382683,r*0.92388);
	glVertex3f(r*0.408248,r*-0.408248,r*0.816497);
	glVertex3f(r*0.382683,r*0,r*0.92388);
	glVertex3f(r*0,r*0,r*1);
	glVertex3f(r*0,r*-0.382683,r*0.92388);
	glVertex3f(r*0.382683,r*0,r*0.92388);
	glVertex3f(r*0,r*-0.707107,r*0.707107);
	glVertex3f(r*0.408248,r*-0.408248,r*0.816497);
	glVertex3f(r*0,r*-0.382683,r*0.92388);
	glVertex3f(r*0.707107,r*0,r*0.707107);
	glVertex3f(r*0.382683,r*0,r*0.92388);
	glVertex3f(r*0.408248,r*-0.408248,r*0.816497);
	glVertex3f(r*0.408248,r*-0.408248,r*-0.816497);
	glVertex3f(r*0.816497,r*-0.408248,r*-0.408248);
	glVertex3f(r*0.408248,r*-0.816497,r*-0.408248);
	glVertex3f(r*0,r*-0.707107,r*-0.707107);
	glVertex3f(r*0.408248,r*-0.408248,r*-0.816497);
	glVertex3f(r*0.408248,r*-0.816497,r*-0.408248);
	glVertex3f(r*0.707107,r*0,r*-0.707107);
	glVertex3f(r*0.816497,r*-0.408248,r*-0.408248);
	glVertex3f(r*0.408248,r*-0.408248,r*-0.816497);
	glVertex3f(r*0.707107,r*-0.707107,r*0);
	glVertex3f(r*0.408248,r*-0.816497,r*-0.408248);
	glVertex3f(r*0.816497,r*-0.408248,r*-0.408248);
	glVertex3f(r*0,r*-0.92388,r*-0.382683);
	glVertex3f(r*0.408248,r*-0.816497,r*-0.408248);
	glVertex3f(r*0.382683,r*-0.92388,r*0);
	glVertex3f(r*0,r*-1,r*0);
	glVertex3f(r*0,r*-0.92388,r*-0.382683);
	glVertex3f(r*0.382683,r*-0.92388,r*0);
	glVertex3f(r*0,r*-0.707107,r*-0.707107);
	glVertex3f(r*0.408248,r*-0.816497,r*-0.408248);
	glVertex3f(r*0,r*-0.92388,r*-0.382683);
	glVertex3f(r*0.707107,r*-0.707107,r*0);
	glVertex3f(r*0.382683,r*-0.92388,r*0);
	glVertex3f(r*0.408248,r*-0.816497,r*-0.408248);
	glVertex3f(r*0.382683,r*0,r*-0.92388);
	glVertex3f(r*0.408248,r*-0.408248,r*-0.816497);
	glVertex3f(r*0,r*-0.382683,r*-0.92388);
	glVertex3f(r*0,r*0,r*-1);
	glVertex3f(r*0.382683,r*0,r*-0.92388);
	glVertex3f(r*0,r*-0.382683,r*-0.92388);
	glVertex3f(r*0.707107,r*0,r*-0.707107);
	glVertex3f(r*0.408248,r*-0.408248,r*-0.816497);
	glVertex3f(r*0.382683,r*0,r*-0.92388);
	glVertex3f(r*0,r*-0.707107,r*-0.707107);
	glVertex3f(r*0,r*-0.382683,r*-0.92388);
	glVertex3f(r*0.408248,r*-0.408248,r*-0.816497);
	glVertex3f(r*0.92388,r*-0.382683,r*0);
	glVertex3f(r*0.816497,r*-0.408248,r*-0.408248);
	glVertex3f(r*0.92388,r*0,r*-0.382683);
	glVertex3f(r*1,r*0,r*0);
	glVertex3f(r*0.92388,r*-0.382683,r*0);
	glVertex3f(r*0.92388,r*0,r*-0.382683);
	glVertex3f(r*0.707107,r*-0.707107,r*0);
	glVertex3f(r*0.816497,r*-0.408248,r*-0.408248);
	glVertex3f(r*0.92388,r*-0.382683,r*0);
	glVertex3f(r*0.707107,r*0,r*-0.707107);
	glVertex3f(r*0.92388,r*0,r*-0.382683);
	glVertex3f(r*0.816497,r*-0.408248,r*-0.408248);
	glVertex3f(r*-0.816497,r*-0.408248,r*-0.408248);
	glVertex3f(r*-0.408248,r*-0.408248,r*-0.816497);
	glVertex3f(r*-0.408248,r*-0.816497,r*-0.408248);
	glVertex3f(r*-0.707107,r*-0.707107,r*0);
	glVertex3f(r*-0.816497,r*-0.408248,r*-0.408248);
	glVertex3f(r*-0.408248,r*-0.816497,r*-0.408248);
	glVertex3f(r*-0.707107,r*0,r*-0.707107);
	glVertex3f(r*-0.408248,r*-0.408248,r*-0.816497);
	glVertex3f(r*-0.816497,r*-0.408248,r*-0.408248);
	glVertex3f(r*0,r*-0.707107,r*-0.707107);
	glVertex3f(r*-0.408248,r*-0.816497,r*-0.408248);
	glVertex3f(r*-0.408248,r*-0.408248,r*-0.816497);
	glVertex3f(r*-0.382683,r*-0.92388,r*0);
	glVertex3f(r*-0.408248,r*-0.816497,r*-0.408248);
	glVertex3f(r*0,r*-0.92388,r*-0.382683);
	glVertex3f(r*0,r*-1,r*0);
	glVertex3f(r*-0.382683,r*-0.92388,r*0);
	glVertex3f(r*0,r*-0.92388,r*-0.382683);
	glVertex3f(r*-0.707107,r*-0.707107,r*0);
	glVertex3f(r*-0.408248,r*-0.816497,r*-0.408248);
	glVertex3f(r*-0.382683,r*-0.92388,r*0);
	glVertex3f(r*0,r*-0.707107,r*-0.707107);
	glVertex3f(r*0,r*-0.92388,r*-0.382683);
	glVertex3f(r*-0.408248,r*-0.816497,r*-0.408248);
	glVertex3f(r*-0.92388,r*0,r*-0.382683);
	glVertex3f(r*-0.816497,r*-0.408248,r*-0.408248);
	glVertex3f(r*-0.92388,r*-0.382683,r*0);
	glVertex3f(r*-1,r*0,r*0);
	glVertex3f(r*-0.92388,r*0,r*-0.382683);
	glVertex3f(r*-0.92388,r*-0.382683,r*0);
	glVertex3f(r*-0.707107,r*0,r*-0.707107);
	glVertex3f(r*-0.816497,r*-0.408248,r*-0.408248);
	glVertex3f(r*-0.92388,r*0,r*-0.382683);
	glVertex3f(r*-0.707107,r*-0.707107,r*0);
	glVertex3f(r*-0.92388,r*-0.382683,r*0);
	glVertex3f(r*-0.816497,r*-0.408248,r*-0.408248);
	glVertex3f(r*0,r*-0.382683,r*-0.92388);
	glVertex3f(r*-0.408248,r*-0.408248,r*-0.816497);
	glVertex3f(r*-0.382683,r*0,r*-0.92388);
	glVertex3f(r*0,r*0,r*-1);
	glVertex3f(r*0,r*-0.382683,r*-0.92388);
	glVertex3f(r*-0.382683,r*0,r*-0.92388);
	glVertex3f(r*0,r*-0.707107,r*-0.707107);
	glVertex3f(r*-0.408248,r*-0.408248,r*-0.816497);
	glVertex3f(r*0,r*-0.382683,r*-0.92388);
	glVertex3f(r*-0.707107,r*0,r*-0.707107);
	glVertex3f(r*-0.382683,r*0,r*-0.92388);
	glVertex3f(r*-0.408248,r*-0.408248,r*-0.816497);
	glVertex3f(r*-0.408248,r*-0.408248,r*0.816497);
	glVertex3f(r*-0.816497,r*-0.408248,r*0.408248);
	glVertex3f(r*-0.408248,r*-0.816497,r*0.408248);
	glVertex3f(r*0,r*-0.707107,r*0.707107);
	glVertex3f(r*-0.408248,r*-0.408248,r*0.816497);
	glVertex3f(r*-0.408248,r*-0.816497,r*0.408248);
	glVertex3f(r*-0.707107,r*0,r*0.707107);
	glVertex3f(r*-0.816497,r*-0.408248,r*0.408248);
	glVertex3f(r*-0.408248,r*-0.408248,r*0.816497);
	glVertex3f(r*-0.707107,r*-0.707107,r*0);
	glVertex3f(r*-0.408248,r*-0.816497,r*0.408248);
	glVertex3f(r*-0.816497,r*-0.408248,r*0.408248);
	glVertex3f(r*0,r*-0.92388,r*0.382683);
	glVertex3f(r*-0.408248,r*-0.816497,r*0.408248);
	glVertex3f(r*-0.382683,r*-0.92388,r*0);
	glVertex3f(r*0,r*-1,r*0);
	glVertex3f(r*0,r*-0.92388,r*0.382683);
	glVertex3f(r*-0.382683,r*-0.92388,r*0);
	glVertex3f(r*0,r*-0.707107,r*0.707107);
	glVertex3f(r*-0.408248,r*-0.816497,r*0.408248);
	glVertex3f(r*0,r*-0.92388,r*0.382683);
	glVertex3f(r*-0.707107,r*-0.707107,r*0);
	glVertex3f(r*-0.382683,r*-0.92388,r*0);
	glVertex3f(r*-0.408248,r*-0.816497,r*0.408248);
	glVertex3f(r*-0.382683,r*0,r*0.92388);
	glVertex3f(r*-0.408248,r*-0.408248,r*0.816497);
	glVertex3f(r*0,r*-0.382683,r*0.92388);
	glVertex3f(r*0,r*0,r*1);
	glVertex3f(r*-0.382683,r*0,r*0.92388);
	glVertex3f(r*0,r*-0.382683,r*0.92388);
	glVertex3f(r*-0.707107,r*0,r*0.707107);
	glVertex3f(r*-0.408248,r*-0.408248,r*0.816497);
	glVertex3f(r*-0.382683,r*0,r*0.92388);
	glVertex3f(r*0,r*-0.707107,r*0.707107);
	glVertex3f(r*0,r*-0.382683,r*0.92388);
	glVertex3f(r*-0.408248,r*-0.408248,r*0.816497);
	glVertex3f(r*-0.92388,r*-0.382683,r*0);
	glVertex3f(r*-0.816497,r*-0.408248,r*0.408248);
	glVertex3f(r*-0.92388,r*0,r*0.382683);
	glVertex3f(r*-1,r*0,r*0);
	glVertex3f(r*-0.92388,r*-0.382683,r*0);
	glVertex3f(r*-0.92388,r*0,r*0.382683);
	glVertex3f(r*-0.707107,r*-0.707107,r*0);
	glVertex3f(r*-0.816497,r*-0.408248,r*0.408248);
	glVertex3f(r*-0.92388,r*-0.382683,r*0);
	glVertex3f(r*-0.707107,r*0,r*0.707107);
	glVertex3f(r*-0.92388,r*0,r*0.382683);
	glVertex3f(r*-0.816497,r*-0.408248,r*0.408248);
	glPopMatrix(); 
}

void GLPrimitive::box(float lx, float ly, float lz, Material *mat, Matrix4f *t){
	glPushMatrix(); 
	float transform[16]; 
	t->get(transform); 
	glMultMatrixf(transform); 
	//BOX
	//PARAM: lx : x length / ly : y length / lz : z length

if(mat!=NULL){

	mat->gl();

}
	float lx_2 = lx/2, ly_2 = ly/2, lz_2 = lz/2;
	glBegin(GL_QUADS);
	glNormal3f(0,0,+1);
	glVertex3f(-lx_2,-ly_2,+lz_2);
	glVertex3f(+lx_2,-ly_2,+lz_2);
	glVertex3f(+lx_2,+ly_2,+lz_2);
	glVertex3f(-lx_2,+ly_2,+lz_2);
	glNormal3f(0,0,-1);
	glVertex3f(-lx_2,-ly_2,-lz_2);
	glVertex3f(-lx_2,+ly_2,-lz_2);
	glVertex3f(+lx_2,+ly_2,-lz_2);
	glVertex3f(+lx_2,-ly_2,-lz_2);
	glNormal3f(-1,0,0);
	glVertex3f(-lx_2,-ly_2,-lz_2);
	glVertex3f(-lx_2,-ly_2,+lz_2);
	glVertex3f(-lx_2,+ly_2,+lz_2);
	glVertex3f(-lx_2,+ly_2,-lz_2);
	glNormal3f(+1,0,0);
	glVertex3f(+lx_2,-ly_2,-lz_2);
	glVertex3f(+lx_2,+ly_2,-lz_2);
	glVertex3f(+lx_2,+ly_2,+lz_2);
	glVertex3f(+lx_2,-ly_2,+lz_2);
	glNormal3f(0,+1,0);
	glVertex3f(-lx_2,+ly_2,-lz_2);
	glVertex3f(-lx_2,+ly_2,+lz_2);
	glVertex3f(+lx_2,+ly_2,+lz_2);
	glVertex3f(+lx_2,+ly_2,-lz_2);
	glNormal3f(0,-1,0);
	glVertex3f(-lx_2,-ly_2,-lz_2);
	glVertex3f(+lx_2,-ly_2,-lz_2);
	glVertex3f(+lx_2,-ly_2,+lz_2);
	glVertex3f(-lx_2,-ly_2,+lz_2);
	glEnd();
	glPopMatrix(); 
}

void GLPrimitive::wire_box(float lx, float ly, float lz, Material *mat, Matrix4f *t){
	glPushMatrix(); 
	float transform[16]; 
	t->get(transform); 
	glMultMatrixf(transform); 
	//BOX INVERSE
	//PARAM: lx : x length / ly : y length / lz : z length

if(mat!=NULL){

	mat->glInverse();

}
	float lx_2 = (lx/2), ly_2 = (ly/2), lz_2 = (lz/2);
	glBegin(GL_LINE_LOOP);
	glVertex3f(-lx_2,-ly_2,+lz_2);
	glVertex3f(+lx_2,-ly_2,+lz_2);
	glVertex3f(+lx_2,+ly_2,+lz_2);
	glVertex3f(-lx_2,+ly_2,+lz_2);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(-lx_2,-ly_2,-lz_2);
	glVertex3f(-lx_2,+ly_2,-lz_2);
	glVertex3f(+lx_2,+ly_2,-lz_2);
	glVertex3f(+lx_2,-ly_2,-lz_2);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(-lx_2,-ly_2,-lz_2);
	glVertex3f(-lx_2,-ly_2,+lz_2);
	glVertex3f(-lx_2,+ly_2,+lz_2);
	glVertex3f(-lx_2,+ly_2,-lz_2);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(+lx_2,-ly_2,-lz_2);
	glVertex3f(+lx_2,+ly_2,-lz_2);
	glVertex3f(+lx_2,+ly_2,+lz_2);
	glVertex3f(+lx_2,-ly_2,+lz_2);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(-lx_2,+ly_2,-lz_2);
	glVertex3f(-lx_2,+ly_2,+lz_2);
	glVertex3f(+lx_2,+ly_2,+lz_2);
	glVertex3f(+lx_2,+ly_2,-lz_2);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(-lx_2,-ly_2,-lz_2);
	glVertex3f(+lx_2,-ly_2,-lz_2);
	glVertex3f(+lx_2,-ly_2,+lz_2);
	glVertex3f(-lx_2,-ly_2,+lz_2);
	glEnd();
	glPopMatrix(); 
}

void GLPrimitive::capsule(float r, float l, Material *mat, Matrix4f *t){
	glPushMatrix(); 
	float transform[16]; 
	t->get(transform); 
	glMultMatrixf(transform); 
glRotatef(90,1,0,0);
	//SPHERE DIV 1
	//PARAM: r : ray / l : length

if(mat!=NULL){

	mat->gl();

}
	float l_2 = l/2;
	glBegin(GL_TRIANGLES);
	glNormal3f(0,0.707107,0.707107);
	glVertex3f(r*0,r*0.707107+l_2,r*0.707107);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glNormal3f(0.707107,0.707107,0);
	glVertex3f(r*0.707107,r*0.707107+l_2,r*0);
	glNormal3f(0,1,0);
	glVertex3f(r*0,r*1+l_2,r*0);
	glNormal3f(0,0.707107,0.707107);
	glVertex3f(r*0,r*0.707107+l_2,r*0.707107);
	glNormal3f(0.707107,0.707107,0);
	glVertex3f(r*0.707107,r*0.707107+l_2,r*0);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0+l_2,r*1);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glNormal3f(0,0.707107,0.707107);
	glVertex3f(r*0,r*0.707107+l_2,r*0.707107);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0+l_2,r*0);
	glNormal3f(0.707107,0.707107,0);
	glVertex3f(r*0.707107,r*0.707107+l_2,r*0);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glNormal3f(0.707107,0.707107,0);
	glVertex3f(r*0.707107,r*0.707107+l_2,r*0);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glNormal3f(0,0.707107,-0.707107);
	glVertex3f(r*0,r*0.707107+l_2,r*-0.707107);
	glNormal3f(0,1,0);
	glVertex3f(r*0,r*1+l_2,r*0);
	glNormal3f(0.707107,0.707107,0);
	glVertex3f(r*0.707107,r*0.707107+l_2,r*0);
	glNormal3f(0,0.707107,-0.707107);
	glVertex3f(r*0,r*0.707107+l_2,r*-0.707107);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0+l_2,r*0);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glNormal3f(0.707107,0.707107,0);
	glVertex3f(r*0.707107,r*0.707107+l_2,r*0);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0+l_2,r*-1);
	glNormal3f(0,0.707107,-0.707107);
	glVertex3f(r*0,r*0.707107+l_2,r*-0.707107);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glNormal3f(0,0.707107,-0.707107);
	glVertex3f(r*0,r*0.707107+l_2,r*-0.707107);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glNormal3f(-0.707107,0.707107,0);
	glVertex3f(r*-0.707107,r*0.707107+l_2,r*0);
	glNormal3f(0,1,0);
	glVertex3f(r*0,r*1+l_2,r*0);
	glNormal3f(0,0.707107,-0.707107);
	glVertex3f(r*0,r*0.707107+l_2,r*-0.707107);
	glNormal3f(-0.707107,0.707107,0);
	glVertex3f(r*-0.707107,r*0.707107+l_2,r*0);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0+l_2,r*-1);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glNormal3f(0,0.707107,-0.707107);
	glVertex3f(r*0,r*0.707107+l_2,r*-0.707107);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0+l_2,r*0);
	glNormal3f(-0.707107,0.707107,0);
	glVertex3f(r*-0.707107,r*0.707107+l_2,r*0);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glNormal3f(-0.707107,0.707107,0);
	glVertex3f(r*-0.707107,r*0.707107+l_2,r*0);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glNormal3f(0,0.707107,0.707107);
	glVertex3f(r*0,r*0.707107+l_2,r*0.707107);
	glNormal3f(0,1,0);
	glVertex3f(r*0,r*1+l_2,r*0);
	glNormal3f(-0.707107,0.707107,0);
	glVertex3f(r*-0.707107,r*0.707107+l_2,r*0);
	glNormal3f(0,0.707107,0.707107);
	glVertex3f(r*0,r*0.707107+l_2,r*0.707107);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0+l_2,r*0);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glNormal3f(-0.707107,0.707107,0);
	glVertex3f(r*-0.707107,r*0.707107+l_2,r*0);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0+l_2,r*1);
	glNormal3f(0,0.707107,0.707107);
	glVertex3f(r*0,r*0.707107+l_2,r*0.707107);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glNormal3f(0.707107,-0.707107,0);
	glVertex3f(r*0.707107,r*-0.707107-l_2,r*0);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glNormal3f(0,-0.707107,0.707107);
	glVertex3f(r*0,r*-0.707107-l_2,r*0.707107);
	glNormal3f(0,-1,0);
	glVertex3f(r*0,r*-1-l_2,r*0);
	glNormal3f(0.707107,-0.707107,0);
	glVertex3f(r*0.707107,r*-0.707107-l_2,r*0);
	glNormal3f(0,-0.707107,0.707107);
	glVertex3f(r*0,r*-0.707107-l_2,r*0.707107);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0-l_2,r*0);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glNormal3f(0.707107,-0.707107,0);
	glVertex3f(r*0.707107,r*-0.707107-l_2,r*0);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0-l_2,r*1);
	glNormal3f(0,-0.707107,0.707107);
	glVertex3f(r*0,r*-0.707107-l_2,r*0.707107);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glNormal3f(0,-0.707107,-0.707107);
	glVertex3f(r*0,r*-0.707107-l_2,r*-0.707107);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(0.707107,-0.707107,0);
	glVertex3f(r*0.707107,r*-0.707107-l_2,r*0);
	glNormal3f(0,-1,0);
	glVertex3f(r*0,r*-1-l_2,r*0);
	glNormal3f(0,-0.707107,-0.707107);
	glVertex3f(r*0,r*-0.707107-l_2,r*-0.707107);
	glNormal3f(0.707107,-0.707107,0);
	glVertex3f(r*0.707107,r*-0.707107-l_2,r*0);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0-l_2,r*-1);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(0,-0.707107,-0.707107);
	glVertex3f(r*0,r*-0.707107-l_2,r*-0.707107);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0-l_2,r*0);
	glNormal3f(0.707107,-0.707107,0);
	glVertex3f(r*0.707107,r*-0.707107-l_2,r*0);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(-0.707107,-0.707107,0);
	glVertex3f(r*-0.707107,r*-0.707107-l_2,r*0);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(0,-0.707107,-0.707107);
	glVertex3f(r*0,r*-0.707107-l_2,r*-0.707107);
	glNormal3f(0,-1,0);
	glVertex3f(r*0,r*-1-l_2,r*0);
	glNormal3f(-0.707107,-0.707107,0);
	glVertex3f(r*-0.707107,r*-0.707107-l_2,r*0);
	glNormal3f(0,-0.707107,-0.707107);
	glVertex3f(r*0,r*-0.707107-l_2,r*-0.707107);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0-l_2,r*0);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(-0.707107,-0.707107,0);
	glVertex3f(r*-0.707107,r*-0.707107-l_2,r*0);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0-l_2,r*-1);
	glNormal3f(0,-0.707107,-0.707107);
	glVertex3f(r*0,r*-0.707107-l_2,r*-0.707107);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(0,-0.707107,0.707107);
	glVertex3f(r*0,r*-0.707107-l_2,r*0.707107);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glNormal3f(-0.707107,-0.707107,0);
	glVertex3f(r*-0.707107,r*-0.707107-l_2,r*0);
	glNormal3f(0,-1,0);
	glVertex3f(r*0,r*-1-l_2,r*0);
	glNormal3f(0,-0.707107,0.707107);
	glVertex3f(r*0,r*-0.707107-l_2,r*0.707107);
	glNormal3f(-0.707107,-0.707107,0);
	glVertex3f(r*-0.707107,r*-0.707107-l_2,r*0);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0-l_2,r*1);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glNormal3f(0,-0.707107,0.707107);
	glVertex3f(r*0,r*-0.707107-l_2,r*0.707107);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0-l_2,r*0);
	glNormal3f(-0.707107,-0.707107,0);
	glVertex3f(r*-0.707107,r*-0.707107-l_2,r*0);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glEnd();
	glBegin(GL_QUADS);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0-l_2,r*0);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0+l_2,r*0);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0-l_2,r*-1);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0+l_2,r*-1);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0-l_2,r*-1);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0+l_2,r*-1);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0-l_2,r*0);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0+l_2,r*0);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0-l_2,r*0);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0+l_2,r*0);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0-l_2,r*1);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0+l_2,r*1);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0-l_2,r*1);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0+l_2,r*1);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0-l_2,r*0);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0+l_2,r*0);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glEnd();
	glPopMatrix(); 
}

void GLPrimitive::cylinder(float r, float l, Material *mat, Matrix4f *t){
	glPushMatrix(); 
	float transform[16]; 
	t->get(transform); 
	glMultMatrixf(transform); 
glRotatef(90,1,0,0);
	//CYLINDER DIV 1
	//PARAM: r : ray / l : length

if(mat!=NULL){

	mat->gl();

}
	float l_2 = l/2;
	glBegin(GL_QUADS);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0-l_2,r*0);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0+l_2,r*0);
	glEnd();
	glBegin(GL_TRIANGLES);
	glNormal3f(0,-1,0);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glVertex3f(r*1,r*0-l_2,r*0);
	glVertex3f(0,-l_2,0);
	glNormal3f(0,+1,0);
	glVertex3f(r*1,r*0+l_2,r*0);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glVertex3f(0,+l_2,0);
	glEnd();
	glBegin(GL_QUADS);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0-l_2,r*-1);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0+l_2,r*-1);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glEnd();
	glBegin(GL_TRIANGLES);
	glNormal3f(0,-1,0);
	glVertex3f(r*0,r*0-l_2,r*-1);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glVertex3f(0,-l_2,0);
	glNormal3f(0,+1,0);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glVertex3f(r*0,r*0+l_2,r*-1);
	glVertex3f(0,+l_2,0);
	glEnd();
	glBegin(GL_QUADS);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0-l_2,r*-1);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0+l_2,r*-1);
	glEnd();
	glBegin(GL_TRIANGLES);
	glNormal3f(0,-1,0);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glVertex3f(r*0,r*0-l_2,r*-1);
	glVertex3f(0,-l_2,0);
	glNormal3f(0,+1,0);
	glVertex3f(r*0,r*0+l_2,r*-1);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glVertex3f(0,+l_2,0);
	glEnd();
	glBegin(GL_QUADS);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0-l_2,r*0);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0+l_2,r*0);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glEnd();
	glBegin(GL_TRIANGLES);
	glNormal3f(0,-1,0);
	glVertex3f(r*-1,r*0-l_2,r*0);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glVertex3f(0,-l_2,0);
	glNormal3f(0,+1,0);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glVertex3f(r*-1,r*0+l_2,r*0);
	glVertex3f(0,+l_2,0);
	glEnd();
	glBegin(GL_QUADS);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0-l_2,r*0);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0+l_2,r*0);
	glEnd();
	glBegin(GL_TRIANGLES);
	glNormal3f(0,-1,0);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glVertex3f(r*-1,r*0-l_2,r*0);
	glVertex3f(0,-l_2,0);
	glNormal3f(0,+1,0);
	glVertex3f(r*-1,r*0+l_2,r*0);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glVertex3f(0,+l_2,0);
	glEnd();
	glBegin(GL_QUADS);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0-l_2,r*1);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0+l_2,r*1);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glEnd();
	glBegin(GL_TRIANGLES);
	glNormal3f(0,-1,0);
	glVertex3f(r*0,r*0-l_2,r*1);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glVertex3f(0,-l_2,0);
	glNormal3f(0,+1,0);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glVertex3f(r*0,r*0+l_2,r*1);
	glVertex3f(0,+l_2,0);
	glEnd();
	glBegin(GL_QUADS);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0-l_2,r*1);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0+l_2,r*1);
	glEnd();
	glBegin(GL_TRIANGLES);
	glNormal3f(0,-1,0);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glVertex3f(r*0,r*0-l_2,r*1);
	glVertex3f(0,-l_2,0);
	glNormal3f(0,+1,0);
	glVertex3f(r*0,r*0+l_2,r*1);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glVertex3f(0,+l_2,0);
	glEnd();
	glBegin(GL_QUADS);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0-l_2,r*0);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0+l_2,r*0);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glEnd();
	glBegin(GL_TRIANGLES);
	glNormal3f(0,-1,0);
	glVertex3f(r*1,r*0-l_2,r*0);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glVertex3f(0,-l_2,0);
	glNormal3f(0,+1,0);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glVertex3f(r*1,r*0+l_2,r*0);
	glVertex3f(0,+l_2,0);
	glEnd();
	glPopMatrix(); 
}

void GLPrimitive::plane(float s, Material *mat, Matrix4f *t){
	glPushMatrix(); 
	float transform[16]; 
	t->get(transform); 
	glMultMatrixf(transform); 
	//PLANE DIV 10
	//PARAM: s : size

if(mat!=NULL){

	mat->gl();

}
	glBegin(GL_QUADS);
	glNormal3f(0,1,0);
	glVertex3f((0)*s,0,(0)*s);
	glVertex3f((0)*s,0,(0.1)*s);
	glVertex3f((0.1)*s,0,(0.1)*s);
	glVertex3f((0.1)*s,0,(0)*s);

	glVertex3f((0)*s,0,(0.2)*s);
	glVertex3f((0)*s,0,(0.3)*s);
	glVertex3f((0.1)*s,0,(0.3)*s);
	glVertex3f((0.1)*s,0,(0.2)*s);

	glVertex3f((0)*s,0,(0.4)*s);
	glVertex3f((0)*s,0,(0.5)*s);
	glVertex3f((0.1)*s,0,(0.5)*s);
	glVertex3f((0.1)*s,0,(0.4)*s);

	glVertex3f((0)*s,0,(0.6)*s);
	glVertex3f((0)*s,0,(0.7)*s);
	glVertex3f((0.1)*s,0,(0.7)*s);
	glVertex3f((0.1)*s,0,(0.6)*s);

	glVertex3f((0)*s,0,(0.8)*s);
	glVertex3f((0)*s,0,(0.9)*s);
	glVertex3f((0.1)*s,0,(0.9)*s);
	glVertex3f((0.1)*s,0,(0.8)*s);

	glVertex3f((0.1)*s,0,(0.1)*s);
	glVertex3f((0.1)*s,0,(0.2)*s);
	glVertex3f((0.2)*s,0,(0.2)*s);
	glVertex3f((0.2)*s,0,(0.1)*s);

	glVertex3f((0.1)*s,0,(0.3)*s);
	glVertex3f((0.1)*s,0,(0.4)*s);
	glVertex3f((0.2)*s,0,(0.4)*s);
	glVertex3f((0.2)*s,0,(0.3)*s);

	glVertex3f((0.1)*s,0,(0.5)*s);
	glVertex3f((0.1)*s,0,(0.6)*s);
	glVertex3f((0.2)*s,0,(0.6)*s);
	glVertex3f((0.2)*s,0,(0.5)*s);

	glVertex3f((0.1)*s,0,(0.7)*s);
	glVertex3f((0.1)*s,0,(0.8)*s);
	glVertex3f((0.2)*s,0,(0.8)*s);
	glVertex3f((0.2)*s,0,(0.7)*s);

	glVertex3f((0.1)*s,0,(0.9)*s);
	glVertex3f((0.1)*s,0,(1)*s);
	glVertex3f((0.2)*s,0,(1)*s);
	glVertex3f((0.2)*s,0,(0.9)*s);

	glVertex3f((0.2)*s,0,(0)*s);
	glVertex3f((0.2)*s,0,(0.1)*s);
	glVertex3f((0.3)*s,0,(0.1)*s);
	glVertex3f((0.3)*s,0,(0)*s);

	glVertex3f((0.2)*s,0,(0.2)*s);
	glVertex3f((0.2)*s,0,(0.3)*s);
	glVertex3f((0.3)*s,0,(0.3)*s);
	glVertex3f((0.3)*s,0,(0.2)*s);

	glVertex3f((0.2)*s,0,(0.4)*s);
	glVertex3f((0.2)*s,0,(0.5)*s);
	glVertex3f((0.3)*s,0,(0.5)*s);
	glVertex3f((0.3)*s,0,(0.4)*s);

	glVertex3f((0.2)*s,0,(0.6)*s);
	glVertex3f((0.2)*s,0,(0.7)*s);
	glVertex3f((0.3)*s,0,(0.7)*s);
	glVertex3f((0.3)*s,0,(0.6)*s);

	glVertex3f((0.2)*s,0,(0.8)*s);
	glVertex3f((0.2)*s,0,(0.9)*s);
	glVertex3f((0.3)*s,0,(0.9)*s);
	glVertex3f((0.3)*s,0,(0.8)*s);

	glVertex3f((0.3)*s,0,(0.1)*s);
	glVertex3f((0.3)*s,0,(0.2)*s);
	glVertex3f((0.4)*s,0,(0.2)*s);
	glVertex3f((0.4)*s,0,(0.1)*s);

	glVertex3f((0.3)*s,0,(0.3)*s);
	glVertex3f((0.3)*s,0,(0.4)*s);
	glVertex3f((0.4)*s,0,(0.4)*s);
	glVertex3f((0.4)*s,0,(0.3)*s);

	glVertex3f((0.3)*s,0,(0.5)*s);
	glVertex3f((0.3)*s,0,(0.6)*s);
	glVertex3f((0.4)*s,0,(0.6)*s);
	glVertex3f((0.4)*s,0,(0.5)*s);

	glVertex3f((0.3)*s,0,(0.7)*s);
	glVertex3f((0.3)*s,0,(0.8)*s);
	glVertex3f((0.4)*s,0,(0.8)*s);
	glVertex3f((0.4)*s,0,(0.7)*s);

	glVertex3f((0.3)*s,0,(0.9)*s);
	glVertex3f((0.3)*s,0,(1)*s);
	glVertex3f((0.4)*s,0,(1)*s);
	glVertex3f((0.4)*s,0,(0.9)*s);

	glVertex3f((0.4)*s,0,(0)*s);
	glVertex3f((0.4)*s,0,(0.1)*s);
	glVertex3f((0.5)*s,0,(0.1)*s);
	glVertex3f((0.5)*s,0,(0)*s);

	glVertex3f((0.4)*s,0,(0.2)*s);
	glVertex3f((0.4)*s,0,(0.3)*s);
	glVertex3f((0.5)*s,0,(0.3)*s);
	glVertex3f((0.5)*s,0,(0.2)*s);

	glVertex3f((0.4)*s,0,(0.4)*s);
	glVertex3f((0.4)*s,0,(0.5)*s);
	glVertex3f((0.5)*s,0,(0.5)*s);
	glVertex3f((0.5)*s,0,(0.4)*s);

	glVertex3f((0.4)*s,0,(0.6)*s);
	glVertex3f((0.4)*s,0,(0.7)*s);
	glVertex3f((0.5)*s,0,(0.7)*s);
	glVertex3f((0.5)*s,0,(0.6)*s);

	glVertex3f((0.4)*s,0,(0.8)*s);
	glVertex3f((0.4)*s,0,(0.9)*s);
	glVertex3f((0.5)*s,0,(0.9)*s);
	glVertex3f((0.5)*s,0,(0.8)*s);

	glVertex3f((0.5)*s,0,(0.1)*s);
	glVertex3f((0.5)*s,0,(0.2)*s);
	glVertex3f((0.6)*s,0,(0.2)*s);
	glVertex3f((0.6)*s,0,(0.1)*s);

	glVertex3f((0.5)*s,0,(0.3)*s);
	glVertex3f((0.5)*s,0,(0.4)*s);
	glVertex3f((0.6)*s,0,(0.4)*s);
	glVertex3f((0.6)*s,0,(0.3)*s);

	glVertex3f((0.5)*s,0,(0.5)*s);
	glVertex3f((0.5)*s,0,(0.6)*s);
	glVertex3f((0.6)*s,0,(0.6)*s);
	glVertex3f((0.6)*s,0,(0.5)*s);

	glVertex3f((0.5)*s,0,(0.7)*s);
	glVertex3f((0.5)*s,0,(0.8)*s);
	glVertex3f((0.6)*s,0,(0.8)*s);
	glVertex3f((0.6)*s,0,(0.7)*s);

	glVertex3f((0.5)*s,0,(0.9)*s);
	glVertex3f((0.5)*s,0,(1)*s);
	glVertex3f((0.6)*s,0,(1)*s);
	glVertex3f((0.6)*s,0,(0.9)*s);

	glVertex3f((0.6)*s,0,(0)*s);
	glVertex3f((0.6)*s,0,(0.1)*s);
	glVertex3f((0.7)*s,0,(0.1)*s);
	glVertex3f((0.7)*s,0,(0)*s);

	glVertex3f((0.6)*s,0,(0.2)*s);
	glVertex3f((0.6)*s,0,(0.3)*s);
	glVertex3f((0.7)*s,0,(0.3)*s);
	glVertex3f((0.7)*s,0,(0.2)*s);

	glVertex3f((0.6)*s,0,(0.4)*s);
	glVertex3f((0.6)*s,0,(0.5)*s);
	glVertex3f((0.7)*s,0,(0.5)*s);
	glVertex3f((0.7)*s,0,(0.4)*s);

	glVertex3f((0.6)*s,0,(0.6)*s);
	glVertex3f((0.6)*s,0,(0.7)*s);
	glVertex3f((0.7)*s,0,(0.7)*s);
	glVertex3f((0.7)*s,0,(0.6)*s);

	glVertex3f((0.6)*s,0,(0.8)*s);
	glVertex3f((0.6)*s,0,(0.9)*s);
	glVertex3f((0.7)*s,0,(0.9)*s);
	glVertex3f((0.7)*s,0,(0.8)*s);

	glVertex3f((0.7)*s,0,(0.1)*s);
	glVertex3f((0.7)*s,0,(0.2)*s);
	glVertex3f((0.8)*s,0,(0.2)*s);
	glVertex3f((0.8)*s,0,(0.1)*s);

	glVertex3f((0.7)*s,0,(0.3)*s);
	glVertex3f((0.7)*s,0,(0.4)*s);
	glVertex3f((0.8)*s,0,(0.4)*s);
	glVertex3f((0.8)*s,0,(0.3)*s);

	glVertex3f((0.7)*s,0,(0.5)*s);
	glVertex3f((0.7)*s,0,(0.6)*s);
	glVertex3f((0.8)*s,0,(0.6)*s);
	glVertex3f((0.8)*s,0,(0.5)*s);

	glVertex3f((0.7)*s,0,(0.7)*s);
	glVertex3f((0.7)*s,0,(0.8)*s);
	glVertex3f((0.8)*s,0,(0.8)*s);
	glVertex3f((0.8)*s,0,(0.7)*s);

	glVertex3f((0.7)*s,0,(0.9)*s);
	glVertex3f((0.7)*s,0,(1)*s);
	glVertex3f((0.8)*s,0,(1)*s);
	glVertex3f((0.8)*s,0,(0.9)*s);

	glVertex3f((0.8)*s,0,(0)*s);
	glVertex3f((0.8)*s,0,(0.1)*s);
	glVertex3f((0.9)*s,0,(0.1)*s);
	glVertex3f((0.9)*s,0,(0)*s);

	glVertex3f((0.8)*s,0,(0.2)*s);
	glVertex3f((0.8)*s,0,(0.3)*s);
	glVertex3f((0.9)*s,0,(0.3)*s);
	glVertex3f((0.9)*s,0,(0.2)*s);

	glVertex3f((0.8)*s,0,(0.4)*s);
	glVertex3f((0.8)*s,0,(0.5)*s);
	glVertex3f((0.9)*s,0,(0.5)*s);
	glVertex3f((0.9)*s,0,(0.4)*s);

	glVertex3f((0.8)*s,0,(0.6)*s);
	glVertex3f((0.8)*s,0,(0.7)*s);
	glVertex3f((0.9)*s,0,(0.7)*s);
	glVertex3f((0.9)*s,0,(0.6)*s);

	glVertex3f((0.8)*s,0,(0.8)*s);
	glVertex3f((0.8)*s,0,(0.9)*s);
	glVertex3f((0.9)*s,0,(0.9)*s);
	glVertex3f((0.9)*s,0,(0.8)*s);

	glVertex3f((0.9)*s,0,(0.1)*s);
	glVertex3f((0.9)*s,0,(0.2)*s);
	glVertex3f((1)*s,0,(0.2)*s);
	glVertex3f((1)*s,0,(0.1)*s);

	glVertex3f((0.9)*s,0,(0.3)*s);
	glVertex3f((0.9)*s,0,(0.4)*s);
	glVertex3f((1)*s,0,(0.4)*s);
	glVertex3f((1)*s,0,(0.3)*s);

	glVertex3f((0.9)*s,0,(0.5)*s);
	glVertex3f((0.9)*s,0,(0.6)*s);
	glVertex3f((1)*s,0,(0.6)*s);
	glVertex3f((1)*s,0,(0.5)*s);

	glVertex3f((0.9)*s,0,(0.7)*s);
	glVertex3f((0.9)*s,0,(0.8)*s);
	glVertex3f((1)*s,0,(0.8)*s);
	glVertex3f((1)*s,0,(0.7)*s);

	glVertex3f((0.9)*s,0,(0.9)*s);
	glVertex3f((0.9)*s,0,(1)*s);
	glVertex3f((1)*s,0,(1)*s);
	glVertex3f((1)*s,0,(0.9)*s);

	glEnd();

if(mat!=NULL){

	mat->glHalf();

}
	glBegin(GL_QUADS);
	glNormal3f(0,1,0);
	glVertex3f((0)*s,0,(0.1)*s);
	glVertex3f((0)*s,0,(0.2)*s);
	glVertex3f((0.1)*s,0,(0.2)*s);
	glVertex3f((0.1)*s,0,(0.1)*s);

	glVertex3f((0)*s,0,(0.3)*s);
	glVertex3f((0)*s,0,(0.4)*s);
	glVertex3f((0.1)*s,0,(0.4)*s);
	glVertex3f((0.1)*s,0,(0.3)*s);

	glVertex3f((0)*s,0,(0.5)*s);
	glVertex3f((0)*s,0,(0.6)*s);
	glVertex3f((0.1)*s,0,(0.6)*s);
	glVertex3f((0.1)*s,0,(0.5)*s);

	glVertex3f((0)*s,0,(0.7)*s);
	glVertex3f((0)*s,0,(0.8)*s);
	glVertex3f((0.1)*s,0,(0.8)*s);
	glVertex3f((0.1)*s,0,(0.7)*s);

	glVertex3f((0)*s,0,(0.9)*s);
	glVertex3f((0)*s,0,(1)*s);
	glVertex3f((0.1)*s,0,(1)*s);
	glVertex3f((0.1)*s,0,(0.9)*s);

	glVertex3f((0.1)*s,0,(0)*s);
	glVertex3f((0.1)*s,0,(0.1)*s);
	glVertex3f((0.2)*s,0,(0.1)*s);
	glVertex3f((0.2)*s,0,(0)*s);

	glVertex3f((0.1)*s,0,(0.2)*s);
	glVertex3f((0.1)*s,0,(0.3)*s);
	glVertex3f((0.2)*s,0,(0.3)*s);
	glVertex3f((0.2)*s,0,(0.2)*s);

	glVertex3f((0.1)*s,0,(0.4)*s);
	glVertex3f((0.1)*s,0,(0.5)*s);
	glVertex3f((0.2)*s,0,(0.5)*s);
	glVertex3f((0.2)*s,0,(0.4)*s);

	glVertex3f((0.1)*s,0,(0.6)*s);
	glVertex3f((0.1)*s,0,(0.7)*s);
	glVertex3f((0.2)*s,0,(0.7)*s);
	glVertex3f((0.2)*s,0,(0.6)*s);

	glVertex3f((0.1)*s,0,(0.8)*s);
	glVertex3f((0.1)*s,0,(0.9)*s);
	glVertex3f((0.2)*s,0,(0.9)*s);
	glVertex3f((0.2)*s,0,(0.8)*s);

	glVertex3f((0.2)*s,0,(0.1)*s);
	glVertex3f((0.2)*s,0,(0.2)*s);
	glVertex3f((0.3)*s,0,(0.2)*s);
	glVertex3f((0.3)*s,0,(0.1)*s);

	glVertex3f((0.2)*s,0,(0.3)*s);
	glVertex3f((0.2)*s,0,(0.4)*s);
	glVertex3f((0.3)*s,0,(0.4)*s);
	glVertex3f((0.3)*s,0,(0.3)*s);

	glVertex3f((0.2)*s,0,(0.5)*s);
	glVertex3f((0.2)*s,0,(0.6)*s);
	glVertex3f((0.3)*s,0,(0.6)*s);
	glVertex3f((0.3)*s,0,(0.5)*s);

	glVertex3f((0.2)*s,0,(0.7)*s);
	glVertex3f((0.2)*s,0,(0.8)*s);
	glVertex3f((0.3)*s,0,(0.8)*s);
	glVertex3f((0.3)*s,0,(0.7)*s);

	glVertex3f((0.2)*s,0,(0.9)*s);
	glVertex3f((0.2)*s,0,(1)*s);
	glVertex3f((0.3)*s,0,(1)*s);
	glVertex3f((0.3)*s,0,(0.9)*s);

	glVertex3f((0.3)*s,0,(0)*s);
	glVertex3f((0.3)*s,0,(0.1)*s);
	glVertex3f((0.4)*s,0,(0.1)*s);
	glVertex3f((0.4)*s,0,(0)*s);

	glVertex3f((0.3)*s,0,(0.2)*s);
	glVertex3f((0.3)*s,0,(0.3)*s);
	glVertex3f((0.4)*s,0,(0.3)*s);
	glVertex3f((0.4)*s,0,(0.2)*s);

	glVertex3f((0.3)*s,0,(0.4)*s);
	glVertex3f((0.3)*s,0,(0.5)*s);
	glVertex3f((0.4)*s,0,(0.5)*s);
	glVertex3f((0.4)*s,0,(0.4)*s);

	glVertex3f((0.3)*s,0,(0.6)*s);
	glVertex3f((0.3)*s,0,(0.7)*s);
	glVertex3f((0.4)*s,0,(0.7)*s);
	glVertex3f((0.4)*s,0,(0.6)*s);

	glVertex3f((0.3)*s,0,(0.8)*s);
	glVertex3f((0.3)*s,0,(0.9)*s);
	glVertex3f((0.4)*s,0,(0.9)*s);
	glVertex3f((0.4)*s,0,(0.8)*s);

	glVertex3f((0.4)*s,0,(0.1)*s);
	glVertex3f((0.4)*s,0,(0.2)*s);
	glVertex3f((0.5)*s,0,(0.2)*s);
	glVertex3f((0.5)*s,0,(0.1)*s);

	glVertex3f((0.4)*s,0,(0.3)*s);
	glVertex3f((0.4)*s,0,(0.4)*s);
	glVertex3f((0.5)*s,0,(0.4)*s);
	glVertex3f((0.5)*s,0,(0.3)*s);

	glVertex3f((0.4)*s,0,(0.5)*s);
	glVertex3f((0.4)*s,0,(0.6)*s);
	glVertex3f((0.5)*s,0,(0.6)*s);
	glVertex3f((0.5)*s,0,(0.5)*s);

	glVertex3f((0.4)*s,0,(0.7)*s);
	glVertex3f((0.4)*s,0,(0.8)*s);
	glVertex3f((0.5)*s,0,(0.8)*s);
	glVertex3f((0.5)*s,0,(0.7)*s);

	glVertex3f((0.4)*s,0,(0.9)*s);
	glVertex3f((0.4)*s,0,(1)*s);
	glVertex3f((0.5)*s,0,(1)*s);
	glVertex3f((0.5)*s,0,(0.9)*s);

	glVertex3f((0.5)*s,0,(0)*s);
	glVertex3f((0.5)*s,0,(0.1)*s);
	glVertex3f((0.6)*s,0,(0.1)*s);
	glVertex3f((0.6)*s,0,(0)*s);

	glVertex3f((0.5)*s,0,(0.2)*s);
	glVertex3f((0.5)*s,0,(0.3)*s);
	glVertex3f((0.6)*s,0,(0.3)*s);
	glVertex3f((0.6)*s,0,(0.2)*s);

	glVertex3f((0.5)*s,0,(0.4)*s);
	glVertex3f((0.5)*s,0,(0.5)*s);
	glVertex3f((0.6)*s,0,(0.5)*s);
	glVertex3f((0.6)*s,0,(0.4)*s);

	glVertex3f((0.5)*s,0,(0.6)*s);
	glVertex3f((0.5)*s,0,(0.7)*s);
	glVertex3f((0.6)*s,0,(0.7)*s);
	glVertex3f((0.6)*s,0,(0.6)*s);

	glVertex3f((0.5)*s,0,(0.8)*s);
	glVertex3f((0.5)*s,0,(0.9)*s);
	glVertex3f((0.6)*s,0,(0.9)*s);
	glVertex3f((0.6)*s,0,(0.8)*s);

	glVertex3f((0.6)*s,0,(0.1)*s);
	glVertex3f((0.6)*s,0,(0.2)*s);
	glVertex3f((0.7)*s,0,(0.2)*s);
	glVertex3f((0.7)*s,0,(0.1)*s);

	glVertex3f((0.6)*s,0,(0.3)*s);
	glVertex3f((0.6)*s,0,(0.4)*s);
	glVertex3f((0.7)*s,0,(0.4)*s);
	glVertex3f((0.7)*s,0,(0.3)*s);

	glVertex3f((0.6)*s,0,(0.5)*s);
	glVertex3f((0.6)*s,0,(0.6)*s);
	glVertex3f((0.7)*s,0,(0.6)*s);
	glVertex3f((0.7)*s,0,(0.5)*s);

	glVertex3f((0.6)*s,0,(0.7)*s);
	glVertex3f((0.6)*s,0,(0.8)*s);
	glVertex3f((0.7)*s,0,(0.8)*s);
	glVertex3f((0.7)*s,0,(0.7)*s);

	glVertex3f((0.6)*s,0,(0.9)*s);
	glVertex3f((0.6)*s,0,(1)*s);
	glVertex3f((0.7)*s,0,(1)*s);
	glVertex3f((0.7)*s,0,(0.9)*s);

	glVertex3f((0.7)*s,0,(0)*s);
	glVertex3f((0.7)*s,0,(0.1)*s);
	glVertex3f((0.8)*s,0,(0.1)*s);
	glVertex3f((0.8)*s,0,(0)*s);

	glVertex3f((0.7)*s,0,(0.2)*s);
	glVertex3f((0.7)*s,0,(0.3)*s);
	glVertex3f((0.8)*s,0,(0.3)*s);
	glVertex3f((0.8)*s,0,(0.2)*s);

	glVertex3f((0.7)*s,0,(0.4)*s);
	glVertex3f((0.7)*s,0,(0.5)*s);
	glVertex3f((0.8)*s,0,(0.5)*s);
	glVertex3f((0.8)*s,0,(0.4)*s);

	glVertex3f((0.7)*s,0,(0.6)*s);
	glVertex3f((0.7)*s,0,(0.7)*s);
	glVertex3f((0.8)*s,0,(0.7)*s);
	glVertex3f((0.8)*s,0,(0.6)*s);

	glVertex3f((0.7)*s,0,(0.8)*s);
	glVertex3f((0.7)*s,0,(0.9)*s);
	glVertex3f((0.8)*s,0,(0.9)*s);
	glVertex3f((0.8)*s,0,(0.8)*s);

	glVertex3f((0.8)*s,0,(0.1)*s);
	glVertex3f((0.8)*s,0,(0.2)*s);
	glVertex3f((0.9)*s,0,(0.2)*s);
	glVertex3f((0.9)*s,0,(0.1)*s);

	glVertex3f((0.8)*s,0,(0.3)*s);
	glVertex3f((0.8)*s,0,(0.4)*s);
	glVertex3f((0.9)*s,0,(0.4)*s);
	glVertex3f((0.9)*s,0,(0.3)*s);

	glVertex3f((0.8)*s,0,(0.5)*s);
	glVertex3f((0.8)*s,0,(0.6)*s);
	glVertex3f((0.9)*s,0,(0.6)*s);
	glVertex3f((0.9)*s,0,(0.5)*s);

	glVertex3f((0.8)*s,0,(0.7)*s);
	glVertex3f((0.8)*s,0,(0.8)*s);
	glVertex3f((0.9)*s,0,(0.8)*s);
	glVertex3f((0.9)*s,0,(0.7)*s);

	glVertex3f((0.8)*s,0,(0.9)*s);
	glVertex3f((0.8)*s,0,(1)*s);
	glVertex3f((0.9)*s,0,(1)*s);
	glVertex3f((0.9)*s,0,(0.9)*s);

	glVertex3f((0.9)*s,0,(0)*s);
	glVertex3f((0.9)*s,0,(0.1)*s);
	glVertex3f((1)*s,0,(0.1)*s);
	glVertex3f((1)*s,0,(0)*s);

	glVertex3f((0.9)*s,0,(0.2)*s);
	glVertex3f((0.9)*s,0,(0.3)*s);
	glVertex3f((1)*s,0,(0.3)*s);
	glVertex3f((1)*s,0,(0.2)*s);

	glVertex3f((0.9)*s,0,(0.4)*s);
	glVertex3f((0.9)*s,0,(0.5)*s);
	glVertex3f((1)*s,0,(0.5)*s);
	glVertex3f((1)*s,0,(0.4)*s);

	glVertex3f((0.9)*s,0,(0.6)*s);
	glVertex3f((0.9)*s,0,(0.7)*s);
	glVertex3f((1)*s,0,(0.7)*s);
	glVertex3f((1)*s,0,(0.6)*s);

	glVertex3f((0.9)*s,0,(0.8)*s);
	glVertex3f((0.9)*s,0,(0.9)*s);
	glVertex3f((1)*s,0,(0.9)*s);
	glVertex3f((1)*s,0,(0.8)*s);

	glEnd();
	glPopMatrix(); 
}

void GLPrimitive::floor(float s, Material *mat){
	//PARAM: s : size

if(mat!=NULL){

	mat->gl();

}
	glBegin(GL_QUADS);
	glNormal3f(0,1,0);
	glVertex3f(s*(-1),0,s*(-1));
	glVertex3f(s*(-1),0,s*(-0.9));
	glVertex3f(s*(-0.9),0,s*(-0.9));
	glVertex3f(s*(-0.9),0,s*(-1));
	glVertex3f(s*(-1),0,s*(-0.8));
	glVertex3f(s*(-1),0,s*(-0.7));
	glVertex3f(s*(-0.9),0,s*(-0.7));
	glVertex3f(s*(-0.9),0,s*(-0.8));
	glVertex3f(s*(-1),0,s*(-0.6));
	glVertex3f(s*(-1),0,s*(-0.5));
	glVertex3f(s*(-0.9),0,s*(-0.5));
	glVertex3f(s*(-0.9),0,s*(-0.6));
	glVertex3f(s*(-1),0,s*(-0.4));
	glVertex3f(s*(-1),0,s*(-0.3));
	glVertex3f(s*(-0.9),0,s*(-0.3));
	glVertex3f(s*(-0.9),0,s*(-0.4));
	glVertex3f(s*(-1),0,s*(-0.2));
	glVertex3f(s*(-1),0,s*(-0.1));
	glVertex3f(s*(-0.9),0,s*(-0.1));
	glVertex3f(s*(-0.9),0,s*(-0.2));
	glVertex3f(s*(-1),0,s*(0));
	glVertex3f(s*(-1),0,s*(0.1));
	glVertex3f(s*(-0.9),0,s*(0.1));
	glVertex3f(s*(-0.9),0,s*(0));
	glVertex3f(s*(-1),0,s*(0.2));
	glVertex3f(s*(-1),0,s*(0.3));
	glVertex3f(s*(-0.9),0,s*(0.3));
	glVertex3f(s*(-0.9),0,s*(0.2));
	glVertex3f(s*(-1),0,s*(0.4));
	glVertex3f(s*(-1),0,s*(0.5));
	glVertex3f(s*(-0.9),0,s*(0.5));
	glVertex3f(s*(-0.9),0,s*(0.4));
	glVertex3f(s*(-1),0,s*(0.6));
	glVertex3f(s*(-1),0,s*(0.7));
	glVertex3f(s*(-0.9),0,s*(0.7));
	glVertex3f(s*(-0.9),0,s*(0.6));
	glVertex3f(s*(-1),0,s*(0.8));
	glVertex3f(s*(-1),0,s*(0.9));
	glVertex3f(s*(-0.9),0,s*(0.9));
	glVertex3f(s*(-0.9),0,s*(0.8));
	glVertex3f(s*(-0.9),0,s*(-0.9));
	glVertex3f(s*(-0.9),0,s*(-0.8));
	glVertex3f(s*(-0.8),0,s*(-0.8));
	glVertex3f(s*(-0.8),0,s*(-0.9));
	glVertex3f(s*(-0.9),0,s*(-0.7));
	glVertex3f(s*(-0.9),0,s*(-0.6));
	glVertex3f(s*(-0.8),0,s*(-0.6));
	glVertex3f(s*(-0.8),0,s*(-0.7));
	glVertex3f(s*(-0.9),0,s*(-0.5));
	glVertex3f(s*(-0.9),0,s*(-0.4));
	glVertex3f(s*(-0.8),0,s*(-0.4));
	glVertex3f(s*(-0.8),0,s*(-0.5));
	glVertex3f(s*(-0.9),0,s*(-0.3));
	glVertex3f(s*(-0.9),0,s*(-0.2));
	glVertex3f(s*(-0.8),0,s*(-0.2));
	glVertex3f(s*(-0.8),0,s*(-0.3));
	glVertex3f(s*(-0.9),0,s*(-0.1));
	glVertex3f(s*(-0.9),0,s*(0));
	glVertex3f(s*(-0.8),0,s*(0));
	glVertex3f(s*(-0.8),0,s*(-0.1));
	glVertex3f(s*(-0.9),0,s*(0.1));
	glVertex3f(s*(-0.9),0,s*(0.2));
	glVertex3f(s*(-0.8),0,s*(0.2));
	glVertex3f(s*(-0.8),0,s*(0.1));
	glVertex3f(s*(-0.9),0,s*(0.3));
	glVertex3f(s*(-0.9),0,s*(0.4));
	glVertex3f(s*(-0.8),0,s*(0.4));
	glVertex3f(s*(-0.8),0,s*(0.3));
	glVertex3f(s*(-0.9),0,s*(0.5));
	glVertex3f(s*(-0.9),0,s*(0.6));
	glVertex3f(s*(-0.8),0,s*(0.6));
	glVertex3f(s*(-0.8),0,s*(0.5));
	glVertex3f(s*(-0.9),0,s*(0.7));
	glVertex3f(s*(-0.9),0,s*(0.8));
	glVertex3f(s*(-0.8),0,s*(0.8));
	glVertex3f(s*(-0.8),0,s*(0.7));
	glVertex3f(s*(-0.9),0,s*(0.9));
	glVertex3f(s*(-0.9),0,s*(1));
	glVertex3f(s*(-0.8),0,s*(1));
	glVertex3f(s*(-0.8),0,s*(0.9));
	glVertex3f(s*(-0.8),0,s*(-1));
	glVertex3f(s*(-0.8),0,s*(-0.9));
	glVertex3f(s*(-0.7),0,s*(-0.9));
	glVertex3f(s*(-0.7),0,s*(-1));
	glVertex3f(s*(-0.8),0,s*(-0.8));
	glVertex3f(s*(-0.8),0,s*(-0.7));
	glVertex3f(s*(-0.7),0,s*(-0.7));
	glVertex3f(s*(-0.7),0,s*(-0.8));
	glVertex3f(s*(-0.8),0,s*(-0.6));
	glVertex3f(s*(-0.8),0,s*(-0.5));
	glVertex3f(s*(-0.7),0,s*(-0.5));
	glVertex3f(s*(-0.7),0,s*(-0.6));
	glVertex3f(s*(-0.8),0,s*(-0.4));
	glVertex3f(s*(-0.8),0,s*(-0.3));
	glVertex3f(s*(-0.7),0,s*(-0.3));
	glVertex3f(s*(-0.7),0,s*(-0.4));
	glVertex3f(s*(-0.8),0,s*(-0.2));
	glVertex3f(s*(-0.8),0,s*(-0.1));
	glVertex3f(s*(-0.7),0,s*(-0.1));
	glVertex3f(s*(-0.7),0,s*(-0.2));
	glVertex3f(s*(-0.8),0,s*(0));
	glVertex3f(s*(-0.8),0,s*(0.1));
	glVertex3f(s*(-0.7),0,s*(0.1));
	glVertex3f(s*(-0.7),0,s*(0));
	glVertex3f(s*(-0.8),0,s*(0.2));
	glVertex3f(s*(-0.8),0,s*(0.3));
	glVertex3f(s*(-0.7),0,s*(0.3));
	glVertex3f(s*(-0.7),0,s*(0.2));
	glVertex3f(s*(-0.8),0,s*(0.4));
	glVertex3f(s*(-0.8),0,s*(0.5));
	glVertex3f(s*(-0.7),0,s*(0.5));
	glVertex3f(s*(-0.7),0,s*(0.4));
	glVertex3f(s*(-0.8),0,s*(0.6));
	glVertex3f(s*(-0.8),0,s*(0.7));
	glVertex3f(s*(-0.7),0,s*(0.7));
	glVertex3f(s*(-0.7),0,s*(0.6));
	glVertex3f(s*(-0.8),0,s*(0.8));
	glVertex3f(s*(-0.8),0,s*(0.9));
	glVertex3f(s*(-0.7),0,s*(0.9));
	glVertex3f(s*(-0.7),0,s*(0.8));
	glVertex3f(s*(-0.7),0,s*(-0.9));
	glVertex3f(s*(-0.7),0,s*(-0.8));
	glVertex3f(s*(-0.6),0,s*(-0.8));
	glVertex3f(s*(-0.6),0,s*(-0.9));
	glVertex3f(s*(-0.7),0,s*(-0.7));
	glVertex3f(s*(-0.7),0,s*(-0.6));
	glVertex3f(s*(-0.6),0,s*(-0.6));
	glVertex3f(s*(-0.6),0,s*(-0.7));
	glVertex3f(s*(-0.7),0,s*(-0.5));
	glVertex3f(s*(-0.7),0,s*(-0.4));
	glVertex3f(s*(-0.6),0,s*(-0.4));
	glVertex3f(s*(-0.6),0,s*(-0.5));
	glVertex3f(s*(-0.7),0,s*(-0.3));
	glVertex3f(s*(-0.7),0,s*(-0.2));
	glVertex3f(s*(-0.6),0,s*(-0.2));
	glVertex3f(s*(-0.6),0,s*(-0.3));
	glVertex3f(s*(-0.7),0,s*(-0.1));
	glVertex3f(s*(-0.7),0,s*(0));
	glVertex3f(s*(-0.6),0,s*(0));
	glVertex3f(s*(-0.6),0,s*(-0.1));
	glVertex3f(s*(-0.7),0,s*(0.1));
	glVertex3f(s*(-0.7),0,s*(0.2));
	glVertex3f(s*(-0.6),0,s*(0.2));
	glVertex3f(s*(-0.6),0,s*(0.1));
	glVertex3f(s*(-0.7),0,s*(0.3));
	glVertex3f(s*(-0.7),0,s*(0.4));
	glVertex3f(s*(-0.6),0,s*(0.4));
	glVertex3f(s*(-0.6),0,s*(0.3));
	glVertex3f(s*(-0.7),0,s*(0.5));
	glVertex3f(s*(-0.7),0,s*(0.6));
	glVertex3f(s*(-0.6),0,s*(0.6));
	glVertex3f(s*(-0.6),0,s*(0.5));
	glVertex3f(s*(-0.7),0,s*(0.7));
	glVertex3f(s*(-0.7),0,s*(0.8));
	glVertex3f(s*(-0.6),0,s*(0.8));
	glVertex3f(s*(-0.6),0,s*(0.7));
	glVertex3f(s*(-0.7),0,s*(0.9));
	glVertex3f(s*(-0.7),0,s*(1));
	glVertex3f(s*(-0.6),0,s*(1));
	glVertex3f(s*(-0.6),0,s*(0.9));
	glVertex3f(s*(-0.6),0,s*(-1));
	glVertex3f(s*(-0.6),0,s*(-0.9));
	glVertex3f(s*(-0.5),0,s*(-0.9));
	glVertex3f(s*(-0.5),0,s*(-1));
	glVertex3f(s*(-0.6),0,s*(-0.8));
	glVertex3f(s*(-0.6),0,s*(-0.7));
	glVertex3f(s*(-0.5),0,s*(-0.7));
	glVertex3f(s*(-0.5),0,s*(-0.8));
	glVertex3f(s*(-0.6),0,s*(-0.6));
	glVertex3f(s*(-0.6),0,s*(-0.5));
	glVertex3f(s*(-0.5),0,s*(-0.5));
	glVertex3f(s*(-0.5),0,s*(-0.6));
	glVertex3f(s*(-0.6),0,s*(-0.4));
	glVertex3f(s*(-0.6),0,s*(-0.3));
	glVertex3f(s*(-0.5),0,s*(-0.3));
	glVertex3f(s*(-0.5),0,s*(-0.4));
	glVertex3f(s*(-0.6),0,s*(-0.2));
	glVertex3f(s*(-0.6),0,s*(-0.1));
	glVertex3f(s*(-0.5),0,s*(-0.1));
	glVertex3f(s*(-0.5),0,s*(-0.2));
	glVertex3f(s*(-0.6),0,s*(0));
	glVertex3f(s*(-0.6),0,s*(0.1));
	glVertex3f(s*(-0.5),0,s*(0.1));
	glVertex3f(s*(-0.5),0,s*(0));
	glVertex3f(s*(-0.6),0,s*(0.2));
	glVertex3f(s*(-0.6),0,s*(0.3));
	glVertex3f(s*(-0.5),0,s*(0.3));
	glVertex3f(s*(-0.5),0,s*(0.2));
	glVertex3f(s*(-0.6),0,s*(0.4));
	glVertex3f(s*(-0.6),0,s*(0.5));
	glVertex3f(s*(-0.5),0,s*(0.5));
	glVertex3f(s*(-0.5),0,s*(0.4));
	glVertex3f(s*(-0.6),0,s*(0.6));
	glVertex3f(s*(-0.6),0,s*(0.7));
	glVertex3f(s*(-0.5),0,s*(0.7));
	glVertex3f(s*(-0.5),0,s*(0.6));
	glVertex3f(s*(-0.6),0,s*(0.8));
	glVertex3f(s*(-0.6),0,s*(0.9));
	glVertex3f(s*(-0.5),0,s*(0.9));
	glVertex3f(s*(-0.5),0,s*(0.8));
	glVertex3f(s*(-0.5),0,s*(-0.9));
	glVertex3f(s*(-0.5),0,s*(-0.8));
	glVertex3f(s*(-0.4),0,s*(-0.8));
	glVertex3f(s*(-0.4),0,s*(-0.9));
	glVertex3f(s*(-0.5),0,s*(-0.7));
	glVertex3f(s*(-0.5),0,s*(-0.6));
	glVertex3f(s*(-0.4),0,s*(-0.6));
	glVertex3f(s*(-0.4),0,s*(-0.7));
	glVertex3f(s*(-0.5),0,s*(-0.5));
	glVertex3f(s*(-0.5),0,s*(-0.4));
	glVertex3f(s*(-0.4),0,s*(-0.4));
	glVertex3f(s*(-0.4),0,s*(-0.5));
	glVertex3f(s*(-0.5),0,s*(-0.3));
	glVertex3f(s*(-0.5),0,s*(-0.2));
	glVertex3f(s*(-0.4),0,s*(-0.2));
	glVertex3f(s*(-0.4),0,s*(-0.3));
	glVertex3f(s*(-0.5),0,s*(-0.1));
	glVertex3f(s*(-0.5),0,s*(0));
	glVertex3f(s*(-0.4),0,s*(0));
	glVertex3f(s*(-0.4),0,s*(-0.1));
	glVertex3f(s*(-0.5),0,s*(0.1));
	glVertex3f(s*(-0.5),0,s*(0.2));
	glVertex3f(s*(-0.4),0,s*(0.2));
	glVertex3f(s*(-0.4),0,s*(0.1));
	glVertex3f(s*(-0.5),0,s*(0.3));
	glVertex3f(s*(-0.5),0,s*(0.4));
	glVertex3f(s*(-0.4),0,s*(0.4));
	glVertex3f(s*(-0.4),0,s*(0.3));
	glVertex3f(s*(-0.5),0,s*(0.5));
	glVertex3f(s*(-0.5),0,s*(0.6));
	glVertex3f(s*(-0.4),0,s*(0.6));
	glVertex3f(s*(-0.4),0,s*(0.5));
	glVertex3f(s*(-0.5),0,s*(0.7));
	glVertex3f(s*(-0.5),0,s*(0.8));
	glVertex3f(s*(-0.4),0,s*(0.8));
	glVertex3f(s*(-0.4),0,s*(0.7));
	glVertex3f(s*(-0.5),0,s*(0.9));
	glVertex3f(s*(-0.5),0,s*(1));
	glVertex3f(s*(-0.4),0,s*(1));
	glVertex3f(s*(-0.4),0,s*(0.9));
	glVertex3f(s*(-0.4),0,s*(-1));
	glVertex3f(s*(-0.4),0,s*(-0.9));
	glVertex3f(s*(-0.3),0,s*(-0.9));
	glVertex3f(s*(-0.3),0,s*(-1));
	glVertex3f(s*(-0.4),0,s*(-0.8));
	glVertex3f(s*(-0.4),0,s*(-0.7));
	glVertex3f(s*(-0.3),0,s*(-0.7));
	glVertex3f(s*(-0.3),0,s*(-0.8));
	glVertex3f(s*(-0.4),0,s*(-0.6));
	glVertex3f(s*(-0.4),0,s*(-0.5));
	glVertex3f(s*(-0.3),0,s*(-0.5));
	glVertex3f(s*(-0.3),0,s*(-0.6));
	glVertex3f(s*(-0.4),0,s*(-0.4));
	glVertex3f(s*(-0.4),0,s*(-0.3));
	glVertex3f(s*(-0.3),0,s*(-0.3));
	glVertex3f(s*(-0.3),0,s*(-0.4));
	glVertex3f(s*(-0.4),0,s*(-0.2));
	glVertex3f(s*(-0.4),0,s*(-0.1));
	glVertex3f(s*(-0.3),0,s*(-0.1));
	glVertex3f(s*(-0.3),0,s*(-0.2));
	glVertex3f(s*(-0.4),0,s*(0));
	glVertex3f(s*(-0.4),0,s*(0.1));
	glVertex3f(s*(-0.3),0,s*(0.1));
	glVertex3f(s*(-0.3),0,s*(0));
	glVertex3f(s*(-0.4),0,s*(0.2));
	glVertex3f(s*(-0.4),0,s*(0.3));
	glVertex3f(s*(-0.3),0,s*(0.3));
	glVertex3f(s*(-0.3),0,s*(0.2));
	glVertex3f(s*(-0.4),0,s*(0.4));
	glVertex3f(s*(-0.4),0,s*(0.5));
	glVertex3f(s*(-0.3),0,s*(0.5));
	glVertex3f(s*(-0.3),0,s*(0.4));
	glVertex3f(s*(-0.4),0,s*(0.6));
	glVertex3f(s*(-0.4),0,s*(0.7));
	glVertex3f(s*(-0.3),0,s*(0.7));
	glVertex3f(s*(-0.3),0,s*(0.6));
	glVertex3f(s*(-0.4),0,s*(0.8));
	glVertex3f(s*(-0.4),0,s*(0.9));
	glVertex3f(s*(-0.3),0,s*(0.9));
	glVertex3f(s*(-0.3),0,s*(0.8));
	glVertex3f(s*(-0.3),0,s*(-0.9));
	glVertex3f(s*(-0.3),0,s*(-0.8));
	glVertex3f(s*(-0.2),0,s*(-0.8));
	glVertex3f(s*(-0.2),0,s*(-0.9));
	glVertex3f(s*(-0.3),0,s*(-0.7));
	glVertex3f(s*(-0.3),0,s*(-0.6));
	glVertex3f(s*(-0.2),0,s*(-0.6));
	glVertex3f(s*(-0.2),0,s*(-0.7));
	glVertex3f(s*(-0.3),0,s*(-0.5));
	glVertex3f(s*(-0.3),0,s*(-0.4));
	glVertex3f(s*(-0.2),0,s*(-0.4));
	glVertex3f(s*(-0.2),0,s*(-0.5));
	glVertex3f(s*(-0.3),0,s*(-0.3));
	glVertex3f(s*(-0.3),0,s*(-0.2));
	glVertex3f(s*(-0.2),0,s*(-0.2));
	glVertex3f(s*(-0.2),0,s*(-0.3));
	glVertex3f(s*(-0.3),0,s*(-0.1));
	glVertex3f(s*(-0.3),0,s*(0));
	glVertex3f(s*(-0.2),0,s*(0));
	glVertex3f(s*(-0.2),0,s*(-0.1));
	glVertex3f(s*(-0.3),0,s*(0.1));
	glVertex3f(s*(-0.3),0,s*(0.2));
	glVertex3f(s*(-0.2),0,s*(0.2));
	glVertex3f(s*(-0.2),0,s*(0.1));
	glVertex3f(s*(-0.3),0,s*(0.3));
	glVertex3f(s*(-0.3),0,s*(0.4));
	glVertex3f(s*(-0.2),0,s*(0.4));
	glVertex3f(s*(-0.2),0,s*(0.3));
	glVertex3f(s*(-0.3),0,s*(0.5));
	glVertex3f(s*(-0.3),0,s*(0.6));
	glVertex3f(s*(-0.2),0,s*(0.6));
	glVertex3f(s*(-0.2),0,s*(0.5));
	glVertex3f(s*(-0.3),0,s*(0.7));
	glVertex3f(s*(-0.3),0,s*(0.8));
	glVertex3f(s*(-0.2),0,s*(0.8));
	glVertex3f(s*(-0.2),0,s*(0.7));
	glVertex3f(s*(-0.3),0,s*(0.9));
	glVertex3f(s*(-0.3),0,s*(1));
	glVertex3f(s*(-0.2),0,s*(1));
	glVertex3f(s*(-0.2),0,s*(0.9));
	glVertex3f(s*(-0.2),0,s*(-1));
	glVertex3f(s*(-0.2),0,s*(-0.9));
	glVertex3f(s*(-0.1),0,s*(-0.9));
	glVertex3f(s*(-0.1),0,s*(-1));
	glVertex3f(s*(-0.2),0,s*(-0.8));
	glVertex3f(s*(-0.2),0,s*(-0.7));
	glVertex3f(s*(-0.1),0,s*(-0.7));
	glVertex3f(s*(-0.1),0,s*(-0.8));
	glVertex3f(s*(-0.2),0,s*(-0.6));
	glVertex3f(s*(-0.2),0,s*(-0.5));
	glVertex3f(s*(-0.1),0,s*(-0.5));
	glVertex3f(s*(-0.1),0,s*(-0.6));
	glVertex3f(s*(-0.2),0,s*(-0.4));
	glVertex3f(s*(-0.2),0,s*(-0.3));
	glVertex3f(s*(-0.1),0,s*(-0.3));
	glVertex3f(s*(-0.1),0,s*(-0.4));
	glVertex3f(s*(-0.2),0,s*(-0.2));
	glVertex3f(s*(-0.2),0,s*(-0.1));
	glVertex3f(s*(-0.1),0,s*(-0.1));
	glVertex3f(s*(-0.1),0,s*(-0.2));
	glVertex3f(s*(-0.2),0,s*(0));
	glVertex3f(s*(-0.2),0,s*(0.1));
	glVertex3f(s*(-0.1),0,s*(0.1));
	glVertex3f(s*(-0.1),0,s*(0));
	glVertex3f(s*(-0.2),0,s*(0.2));
	glVertex3f(s*(-0.2),0,s*(0.3));
	glVertex3f(s*(-0.1),0,s*(0.3));
	glVertex3f(s*(-0.1),0,s*(0.2));
	glVertex3f(s*(-0.2),0,s*(0.4));
	glVertex3f(s*(-0.2),0,s*(0.5));
	glVertex3f(s*(-0.1),0,s*(0.5));
	glVertex3f(s*(-0.1),0,s*(0.4));
	glVertex3f(s*(-0.2),0,s*(0.6));
	glVertex3f(s*(-0.2),0,s*(0.7));
	glVertex3f(s*(-0.1),0,s*(0.7));
	glVertex3f(s*(-0.1),0,s*(0.6));
	glVertex3f(s*(-0.2),0,s*(0.8));
	glVertex3f(s*(-0.2),0,s*(0.9));
	glVertex3f(s*(-0.1),0,s*(0.9));
	glVertex3f(s*(-0.1),0,s*(0.8));
	glVertex3f(s*(-0.1),0,s*(-0.9));
	glVertex3f(s*(-0.1),0,s*(-0.8));
	glVertex3f(s*(0),0,s*(-0.8));
	glVertex3f(s*(0),0,s*(-0.9));
	glVertex3f(s*(-0.1),0,s*(-0.7));
	glVertex3f(s*(-0.1),0,s*(-0.6));
	glVertex3f(s*(0),0,s*(-0.6));
	glVertex3f(s*(0),0,s*(-0.7));
	glVertex3f(s*(-0.1),0,s*(-0.5));
	glVertex3f(s*(-0.1),0,s*(-0.4));
	glVertex3f(s*(0),0,s*(-0.4));
	glVertex3f(s*(0),0,s*(-0.5));
	glVertex3f(s*(-0.1),0,s*(-0.3));
	glVertex3f(s*(-0.1),0,s*(-0.2));
	glVertex3f(s*(0),0,s*(-0.2));
	glVertex3f(s*(0),0,s*(-0.3));
	glVertex3f(s*(-0.1),0,s*(-0.1));
	glVertex3f(s*(-0.1),0,s*(0));
	glVertex3f(s*(0),0,s*(0));
	glVertex3f(s*(0),0,s*(-0.1));
	glVertex3f(s*(-0.1),0,s*(0.1));
	glVertex3f(s*(-0.1),0,s*(0.2));
	glVertex3f(s*(0),0,s*(0.2));
	glVertex3f(s*(0),0,s*(0.1));
	glVertex3f(s*(-0.1),0,s*(0.3));
	glVertex3f(s*(-0.1),0,s*(0.4));
	glVertex3f(s*(0),0,s*(0.4));
	glVertex3f(s*(0),0,s*(0.3));
	glVertex3f(s*(-0.1),0,s*(0.5));
	glVertex3f(s*(-0.1),0,s*(0.6));
	glVertex3f(s*(0),0,s*(0.6));
	glVertex3f(s*(0),0,s*(0.5));
	glVertex3f(s*(-0.1),0,s*(0.7));
	glVertex3f(s*(-0.1),0,s*(0.8));
	glVertex3f(s*(0),0,s*(0.8));
	glVertex3f(s*(0),0,s*(0.7));
	glVertex3f(s*(-0.1),0,s*(0.9));
	glVertex3f(s*(-0.1),0,s*(1));
	glVertex3f(s*(0),0,s*(1));
	glVertex3f(s*(0),0,s*(0.9));
	glVertex3f(s*(0),0,s*(-1));
	glVertex3f(s*(0),0,s*(-0.9));
	glVertex3f(s*(0.1),0,s*(-0.9));
	glVertex3f(s*(0.1),0,s*(-1));
	glVertex3f(s*(0),0,s*(-0.8));
	glVertex3f(s*(0),0,s*(-0.7));
	glVertex3f(s*(0.1),0,s*(-0.7));
	glVertex3f(s*(0.1),0,s*(-0.8));
	glVertex3f(s*(0),0,s*(-0.6));
	glVertex3f(s*(0),0,s*(-0.5));
	glVertex3f(s*(0.1),0,s*(-0.5));
	glVertex3f(s*(0.1),0,s*(-0.6));
	glVertex3f(s*(0),0,s*(-0.4));
	glVertex3f(s*(0),0,s*(-0.3));
	glVertex3f(s*(0.1),0,s*(-0.3));
	glVertex3f(s*(0.1),0,s*(-0.4));
	glVertex3f(s*(0),0,s*(-0.2));
	glVertex3f(s*(0),0,s*(-0.1));
	glVertex3f(s*(0.1),0,s*(-0.1));
	glVertex3f(s*(0.1),0,s*(-0.2));
	glVertex3f(s*(0),0,s*(0));
	glVertex3f(s*(0),0,s*(0.1));
	glVertex3f(s*(0.1),0,s*(0.1));
	glVertex3f(s*(0.1),0,s*(0));
	glVertex3f(s*(0),0,s*(0.2));
	glVertex3f(s*(0),0,s*(0.3));
	glVertex3f(s*(0.1),0,s*(0.3));
	glVertex3f(s*(0.1),0,s*(0.2));
	glVertex3f(s*(0),0,s*(0.4));
	glVertex3f(s*(0),0,s*(0.5));
	glVertex3f(s*(0.1),0,s*(0.5));
	glVertex3f(s*(0.1),0,s*(0.4));
	glVertex3f(s*(0),0,s*(0.6));
	glVertex3f(s*(0),0,s*(0.7));
	glVertex3f(s*(0.1),0,s*(0.7));
	glVertex3f(s*(0.1),0,s*(0.6));
	glVertex3f(s*(0),0,s*(0.8));
	glVertex3f(s*(0),0,s*(0.9));
	glVertex3f(s*(0.1),0,s*(0.9));
	glVertex3f(s*(0.1),0,s*(0.8));
	glVertex3f(s*(0.1),0,s*(-0.9));
	glVertex3f(s*(0.1),0,s*(-0.8));
	glVertex3f(s*(0.2),0,s*(-0.8));
	glVertex3f(s*(0.2),0,s*(-0.9));
	glVertex3f(s*(0.1),0,s*(-0.7));
	glVertex3f(s*(0.1),0,s*(-0.6));
	glVertex3f(s*(0.2),0,s*(-0.6));
	glVertex3f(s*(0.2),0,s*(-0.7));
	glVertex3f(s*(0.1),0,s*(-0.5));
	glVertex3f(s*(0.1),0,s*(-0.4));
	glVertex3f(s*(0.2),0,s*(-0.4));
	glVertex3f(s*(0.2),0,s*(-0.5));
	glVertex3f(s*(0.1),0,s*(-0.3));
	glVertex3f(s*(0.1),0,s*(-0.2));
	glVertex3f(s*(0.2),0,s*(-0.2));
	glVertex3f(s*(0.2),0,s*(-0.3));
	glVertex3f(s*(0.1),0,s*(-0.1));
	glVertex3f(s*(0.1),0,s*(0));
	glVertex3f(s*(0.2),0,s*(0));
	glVertex3f(s*(0.2),0,s*(-0.1));
	glVertex3f(s*(0.1),0,s*(0.1));
	glVertex3f(s*(0.1),0,s*(0.2));
	glVertex3f(s*(0.2),0,s*(0.2));
	glVertex3f(s*(0.2),0,s*(0.1));
	glVertex3f(s*(0.1),0,s*(0.3));
	glVertex3f(s*(0.1),0,s*(0.4));
	glVertex3f(s*(0.2),0,s*(0.4));
	glVertex3f(s*(0.2),0,s*(0.3));
	glVertex3f(s*(0.1),0,s*(0.5));
	glVertex3f(s*(0.1),0,s*(0.6));
	glVertex3f(s*(0.2),0,s*(0.6));
	glVertex3f(s*(0.2),0,s*(0.5));
	glVertex3f(s*(0.1),0,s*(0.7));
	glVertex3f(s*(0.1),0,s*(0.8));
	glVertex3f(s*(0.2),0,s*(0.8));
	glVertex3f(s*(0.2),0,s*(0.7));
	glVertex3f(s*(0.1),0,s*(0.9));
	glVertex3f(s*(0.1),0,s*(1));
	glVertex3f(s*(0.2),0,s*(1));
	glVertex3f(s*(0.2),0,s*(0.9));
	glVertex3f(s*(0.2),0,s*(-1));
	glVertex3f(s*(0.2),0,s*(-0.9));
	glVertex3f(s*(0.3),0,s*(-0.9));
	glVertex3f(s*(0.3),0,s*(-1));
	glVertex3f(s*(0.2),0,s*(-0.8));
	glVertex3f(s*(0.2),0,s*(-0.7));
	glVertex3f(s*(0.3),0,s*(-0.7));
	glVertex3f(s*(0.3),0,s*(-0.8));
	glVertex3f(s*(0.2),0,s*(-0.6));
	glVertex3f(s*(0.2),0,s*(-0.5));
	glVertex3f(s*(0.3),0,s*(-0.5));
	glVertex3f(s*(0.3),0,s*(-0.6));
	glVertex3f(s*(0.2),0,s*(-0.4));
	glVertex3f(s*(0.2),0,s*(-0.3));
	glVertex3f(s*(0.3),0,s*(-0.3));
	glVertex3f(s*(0.3),0,s*(-0.4));
	glVertex3f(s*(0.2),0,s*(-0.2));
	glVertex3f(s*(0.2),0,s*(-0.1));
	glVertex3f(s*(0.3),0,s*(-0.1));
	glVertex3f(s*(0.3),0,s*(-0.2));
	glVertex3f(s*(0.2),0,s*(0));
	glVertex3f(s*(0.2),0,s*(0.1));
	glVertex3f(s*(0.3),0,s*(0.1));
	glVertex3f(s*(0.3),0,s*(0));
	glVertex3f(s*(0.2),0,s*(0.2));
	glVertex3f(s*(0.2),0,s*(0.3));
	glVertex3f(s*(0.3),0,s*(0.3));
	glVertex3f(s*(0.3),0,s*(0.2));
	glVertex3f(s*(0.2),0,s*(0.4));
	glVertex3f(s*(0.2),0,s*(0.5));
	glVertex3f(s*(0.3),0,s*(0.5));
	glVertex3f(s*(0.3),0,s*(0.4));
	glVertex3f(s*(0.2),0,s*(0.6));
	glVertex3f(s*(0.2),0,s*(0.7));
	glVertex3f(s*(0.3),0,s*(0.7));
	glVertex3f(s*(0.3),0,s*(0.6));
	glVertex3f(s*(0.2),0,s*(0.8));
	glVertex3f(s*(0.2),0,s*(0.9));
	glVertex3f(s*(0.3),0,s*(0.9));
	glVertex3f(s*(0.3),0,s*(0.8));
	glVertex3f(s*(0.3),0,s*(-0.9));
	glVertex3f(s*(0.3),0,s*(-0.8));
	glVertex3f(s*(0.4),0,s*(-0.8));
	glVertex3f(s*(0.4),0,s*(-0.9));
	glVertex3f(s*(0.3),0,s*(-0.7));
	glVertex3f(s*(0.3),0,s*(-0.6));
	glVertex3f(s*(0.4),0,s*(-0.6));
	glVertex3f(s*(0.4),0,s*(-0.7));
	glVertex3f(s*(0.3),0,s*(-0.5));
	glVertex3f(s*(0.3),0,s*(-0.4));
	glVertex3f(s*(0.4),0,s*(-0.4));
	glVertex3f(s*(0.4),0,s*(-0.5));
	glVertex3f(s*(0.3),0,s*(-0.3));
	glVertex3f(s*(0.3),0,s*(-0.2));
	glVertex3f(s*(0.4),0,s*(-0.2));
	glVertex3f(s*(0.4),0,s*(-0.3));
	glVertex3f(s*(0.3),0,s*(-0.1));
	glVertex3f(s*(0.3),0,s*(0));
	glVertex3f(s*(0.4),0,s*(0));
	glVertex3f(s*(0.4),0,s*(-0.1));
	glVertex3f(s*(0.3),0,s*(0.1));
	glVertex3f(s*(0.3),0,s*(0.2));
	glVertex3f(s*(0.4),0,s*(0.2));
	glVertex3f(s*(0.4),0,s*(0.1));
	glVertex3f(s*(0.3),0,s*(0.3));
	glVertex3f(s*(0.3),0,s*(0.4));
	glVertex3f(s*(0.4),0,s*(0.4));
	glVertex3f(s*(0.4),0,s*(0.3));
	glVertex3f(s*(0.3),0,s*(0.5));
	glVertex3f(s*(0.3),0,s*(0.6));
	glVertex3f(s*(0.4),0,s*(0.6));
	glVertex3f(s*(0.4),0,s*(0.5));
	glVertex3f(s*(0.3),0,s*(0.7));
	glVertex3f(s*(0.3),0,s*(0.8));
	glVertex3f(s*(0.4),0,s*(0.8));
	glVertex3f(s*(0.4),0,s*(0.7));
	glVertex3f(s*(0.3),0,s*(0.9));
	glVertex3f(s*(0.3),0,s*(1));
	glVertex3f(s*(0.4),0,s*(1));
	glVertex3f(s*(0.4),0,s*(0.9));
	glVertex3f(s*(0.4),0,s*(-1));
	glVertex3f(s*(0.4),0,s*(-0.9));
	glVertex3f(s*(0.5),0,s*(-0.9));
	glVertex3f(s*(0.5),0,s*(-1));
	glVertex3f(s*(0.4),0,s*(-0.8));
	glVertex3f(s*(0.4),0,s*(-0.7));
	glVertex3f(s*(0.5),0,s*(-0.7));
	glVertex3f(s*(0.5),0,s*(-0.8));
	glVertex3f(s*(0.4),0,s*(-0.6));
	glVertex3f(s*(0.4),0,s*(-0.5));
	glVertex3f(s*(0.5),0,s*(-0.5));
	glVertex3f(s*(0.5),0,s*(-0.6));
	glVertex3f(s*(0.4),0,s*(-0.4));
	glVertex3f(s*(0.4),0,s*(-0.3));
	glVertex3f(s*(0.5),0,s*(-0.3));
	glVertex3f(s*(0.5),0,s*(-0.4));
	glVertex3f(s*(0.4),0,s*(-0.2));
	glVertex3f(s*(0.4),0,s*(-0.1));
	glVertex3f(s*(0.5),0,s*(-0.1));
	glVertex3f(s*(0.5),0,s*(-0.2));
	glVertex3f(s*(0.4),0,s*(0));
	glVertex3f(s*(0.4),0,s*(0.1));
	glVertex3f(s*(0.5),0,s*(0.1));
	glVertex3f(s*(0.5),0,s*(0));
	glVertex3f(s*(0.4),0,s*(0.2));
	glVertex3f(s*(0.4),0,s*(0.3));
	glVertex3f(s*(0.5),0,s*(0.3));
	glVertex3f(s*(0.5),0,s*(0.2));
	glVertex3f(s*(0.4),0,s*(0.4));
	glVertex3f(s*(0.4),0,s*(0.5));
	glVertex3f(s*(0.5),0,s*(0.5));
	glVertex3f(s*(0.5),0,s*(0.4));
	glVertex3f(s*(0.4),0,s*(0.6));
	glVertex3f(s*(0.4),0,s*(0.7));
	glVertex3f(s*(0.5),0,s*(0.7));
	glVertex3f(s*(0.5),0,s*(0.6));
	glVertex3f(s*(0.4),0,s*(0.8));
	glVertex3f(s*(0.4),0,s*(0.9));
	glVertex3f(s*(0.5),0,s*(0.9));
	glVertex3f(s*(0.5),0,s*(0.8));
	glVertex3f(s*(0.5),0,s*(-0.9));
	glVertex3f(s*(0.5),0,s*(-0.8));
	glVertex3f(s*(0.6),0,s*(-0.8));
	glVertex3f(s*(0.6),0,s*(-0.9));
	glVertex3f(s*(0.5),0,s*(-0.7));
	glVertex3f(s*(0.5),0,s*(-0.6));
	glVertex3f(s*(0.6),0,s*(-0.6));
	glVertex3f(s*(0.6),0,s*(-0.7));
	glVertex3f(s*(0.5),0,s*(-0.5));
	glVertex3f(s*(0.5),0,s*(-0.4));
	glVertex3f(s*(0.6),0,s*(-0.4));
	glVertex3f(s*(0.6),0,s*(-0.5));
	glVertex3f(s*(0.5),0,s*(-0.3));
	glVertex3f(s*(0.5),0,s*(-0.2));
	glVertex3f(s*(0.6),0,s*(-0.2));
	glVertex3f(s*(0.6),0,s*(-0.3));
	glVertex3f(s*(0.5),0,s*(-0.1));
	glVertex3f(s*(0.5),0,s*(0));
	glVertex3f(s*(0.6),0,s*(0));
	glVertex3f(s*(0.6),0,s*(-0.1));
	glVertex3f(s*(0.5),0,s*(0.1));
	glVertex3f(s*(0.5),0,s*(0.2));
	glVertex3f(s*(0.6),0,s*(0.2));
	glVertex3f(s*(0.6),0,s*(0.1));
	glVertex3f(s*(0.5),0,s*(0.3));
	glVertex3f(s*(0.5),0,s*(0.4));
	glVertex3f(s*(0.6),0,s*(0.4));
	glVertex3f(s*(0.6),0,s*(0.3));
	glVertex3f(s*(0.5),0,s*(0.5));
	glVertex3f(s*(0.5),0,s*(0.6));
	glVertex3f(s*(0.6),0,s*(0.6));
	glVertex3f(s*(0.6),0,s*(0.5));
	glVertex3f(s*(0.5),0,s*(0.7));
	glVertex3f(s*(0.5),0,s*(0.8));
	glVertex3f(s*(0.6),0,s*(0.8));
	glVertex3f(s*(0.6),0,s*(0.7));
	glVertex3f(s*(0.5),0,s*(0.9));
	glVertex3f(s*(0.5),0,s*(1));
	glVertex3f(s*(0.6),0,s*(1));
	glVertex3f(s*(0.6),0,s*(0.9));
	glVertex3f(s*(0.6),0,s*(-1));
	glVertex3f(s*(0.6),0,s*(-0.9));
	glVertex3f(s*(0.7),0,s*(-0.9));
	glVertex3f(s*(0.7),0,s*(-1));
	glVertex3f(s*(0.6),0,s*(-0.8));
	glVertex3f(s*(0.6),0,s*(-0.7));
	glVertex3f(s*(0.7),0,s*(-0.7));
	glVertex3f(s*(0.7),0,s*(-0.8));
	glVertex3f(s*(0.6),0,s*(-0.6));
	glVertex3f(s*(0.6),0,s*(-0.5));
	glVertex3f(s*(0.7),0,s*(-0.5));
	glVertex3f(s*(0.7),0,s*(-0.6));
	glVertex3f(s*(0.6),0,s*(-0.4));
	glVertex3f(s*(0.6),0,s*(-0.3));
	glVertex3f(s*(0.7),0,s*(-0.3));
	glVertex3f(s*(0.7),0,s*(-0.4));
	glVertex3f(s*(0.6),0,s*(-0.2));
	glVertex3f(s*(0.6),0,s*(-0.1));
	glVertex3f(s*(0.7),0,s*(-0.1));
	glVertex3f(s*(0.7),0,s*(-0.2));
	glVertex3f(s*(0.6),0,s*(0));
	glVertex3f(s*(0.6),0,s*(0.1));
	glVertex3f(s*(0.7),0,s*(0.1));
	glVertex3f(s*(0.7),0,s*(0));
	glVertex3f(s*(0.6),0,s*(0.2));
	glVertex3f(s*(0.6),0,s*(0.3));
	glVertex3f(s*(0.7),0,s*(0.3));
	glVertex3f(s*(0.7),0,s*(0.2));
	glVertex3f(s*(0.6),0,s*(0.4));
	glVertex3f(s*(0.6),0,s*(0.5));
	glVertex3f(s*(0.7),0,s*(0.5));
	glVertex3f(s*(0.7),0,s*(0.4));
	glVertex3f(s*(0.6),0,s*(0.6));
	glVertex3f(s*(0.6),0,s*(0.7));
	glVertex3f(s*(0.7),0,s*(0.7));
	glVertex3f(s*(0.7),0,s*(0.6));
	glVertex3f(s*(0.6),0,s*(0.8));
	glVertex3f(s*(0.6),0,s*(0.9));
	glVertex3f(s*(0.7),0,s*(0.9));
	glVertex3f(s*(0.7),0,s*(0.8));
	glVertex3f(s*(0.7),0,s*(-0.9));
	glVertex3f(s*(0.7),0,s*(-0.8));
	glVertex3f(s*(0.8),0,s*(-0.8));
	glVertex3f(s*(0.8),0,s*(-0.9));
	glVertex3f(s*(0.7),0,s*(-0.7));
	glVertex3f(s*(0.7),0,s*(-0.6));
	glVertex3f(s*(0.8),0,s*(-0.6));
	glVertex3f(s*(0.8),0,s*(-0.7));
	glVertex3f(s*(0.7),0,s*(-0.5));
	glVertex3f(s*(0.7),0,s*(-0.4));
	glVertex3f(s*(0.8),0,s*(-0.4));
	glVertex3f(s*(0.8),0,s*(-0.5));
	glVertex3f(s*(0.7),0,s*(-0.3));
	glVertex3f(s*(0.7),0,s*(-0.2));
	glVertex3f(s*(0.8),0,s*(-0.2));
	glVertex3f(s*(0.8),0,s*(-0.3));
	glVertex3f(s*(0.7),0,s*(-0.1));
	glVertex3f(s*(0.7),0,s*(0));
	glVertex3f(s*(0.8),0,s*(0));
	glVertex3f(s*(0.8),0,s*(-0.1));
	glVertex3f(s*(0.7),0,s*(0.1));
	glVertex3f(s*(0.7),0,s*(0.2));
	glVertex3f(s*(0.8),0,s*(0.2));
	glVertex3f(s*(0.8),0,s*(0.1));
	glVertex3f(s*(0.7),0,s*(0.3));
	glVertex3f(s*(0.7),0,s*(0.4));
	glVertex3f(s*(0.8),0,s*(0.4));
	glVertex3f(s*(0.8),0,s*(0.3));
	glVertex3f(s*(0.7),0,s*(0.5));
	glVertex3f(s*(0.7),0,s*(0.6));
	glVertex3f(s*(0.8),0,s*(0.6));
	glVertex3f(s*(0.8),0,s*(0.5));
	glVertex3f(s*(0.7),0,s*(0.7));
	glVertex3f(s*(0.7),0,s*(0.8));
	glVertex3f(s*(0.8),0,s*(0.8));
	glVertex3f(s*(0.8),0,s*(0.7));
	glVertex3f(s*(0.7),0,s*(0.9));
	glVertex3f(s*(0.7),0,s*(1));
	glVertex3f(s*(0.8),0,s*(1));
	glVertex3f(s*(0.8),0,s*(0.9));
	glVertex3f(s*(0.8),0,s*(-1));
	glVertex3f(s*(0.8),0,s*(-0.9));
	glVertex3f(s*(0.9),0,s*(-0.9));
	glVertex3f(s*(0.9),0,s*(-1));
	glVertex3f(s*(0.8),0,s*(-0.8));
	glVertex3f(s*(0.8),0,s*(-0.7));
	glVertex3f(s*(0.9),0,s*(-0.7));
	glVertex3f(s*(0.9),0,s*(-0.8));
	glVertex3f(s*(0.8),0,s*(-0.6));
	glVertex3f(s*(0.8),0,s*(-0.5));
	glVertex3f(s*(0.9),0,s*(-0.5));
	glVertex3f(s*(0.9),0,s*(-0.6));
	glVertex3f(s*(0.8),0,s*(-0.4));
	glVertex3f(s*(0.8),0,s*(-0.3));
	glVertex3f(s*(0.9),0,s*(-0.3));
	glVertex3f(s*(0.9),0,s*(-0.4));
	glVertex3f(s*(0.8),0,s*(-0.2));
	glVertex3f(s*(0.8),0,s*(-0.1));
	glVertex3f(s*(0.9),0,s*(-0.1));
	glVertex3f(s*(0.9),0,s*(-0.2));
	glVertex3f(s*(0.8),0,s*(0));
	glVertex3f(s*(0.8),0,s*(0.1));
	glVertex3f(s*(0.9),0,s*(0.1));
	glVertex3f(s*(0.9),0,s*(0));
	glVertex3f(s*(0.8),0,s*(0.2));
	glVertex3f(s*(0.8),0,s*(0.3));
	glVertex3f(s*(0.9),0,s*(0.3));
	glVertex3f(s*(0.9),0,s*(0.2));
	glVertex3f(s*(0.8),0,s*(0.4));
	glVertex3f(s*(0.8),0,s*(0.5));
	glVertex3f(s*(0.9),0,s*(0.5));
	glVertex3f(s*(0.9),0,s*(0.4));
	glVertex3f(s*(0.8),0,s*(0.6));
	glVertex3f(s*(0.8),0,s*(0.7));
	glVertex3f(s*(0.9),0,s*(0.7));
	glVertex3f(s*(0.9),0,s*(0.6));
	glVertex3f(s*(0.8),0,s*(0.8));
	glVertex3f(s*(0.8),0,s*(0.9));
	glVertex3f(s*(0.9),0,s*(0.9));
	glVertex3f(s*(0.9),0,s*(0.8));
	glVertex3f(s*(0.9),0,s*(-0.9));
	glVertex3f(s*(0.9),0,s*(-0.8));
	glVertex3f(s*(1),0,s*(-0.8));
	glVertex3f(s*(1),0,s*(-0.9));
	glVertex3f(s*(0.9),0,s*(-0.7));
	glVertex3f(s*(0.9),0,s*(-0.6));
	glVertex3f(s*(1),0,s*(-0.6));
	glVertex3f(s*(1),0,s*(-0.7));
	glVertex3f(s*(0.9),0,s*(-0.5));
	glVertex3f(s*(0.9),0,s*(-0.4));
	glVertex3f(s*(1),0,s*(-0.4));
	glVertex3f(s*(1),0,s*(-0.5));
	glVertex3f(s*(0.9),0,s*(-0.3));
	glVertex3f(s*(0.9),0,s*(-0.2));
	glVertex3f(s*(1),0,s*(-0.2));
	glVertex3f(s*(1),0,s*(-0.3));
	glVertex3f(s*(0.9),0,s*(-0.1));
	glVertex3f(s*(0.9),0,s*(0));
	glVertex3f(s*(1),0,s*(0));
	glVertex3f(s*(1),0,s*(-0.1));
	glVertex3f(s*(0.9),0,s*(0.1));
	glVertex3f(s*(0.9),0,s*(0.2));
	glVertex3f(s*(1),0,s*(0.2));
	glVertex3f(s*(1),0,s*(0.1));
	glVertex3f(s*(0.9),0,s*(0.3));
	glVertex3f(s*(0.9),0,s*(0.4));
	glVertex3f(s*(1),0,s*(0.4));
	glVertex3f(s*(1),0,s*(0.3));
	glVertex3f(s*(0.9),0,s*(0.5));
	glVertex3f(s*(0.9),0,s*(0.6));
	glVertex3f(s*(1),0,s*(0.6));
	glVertex3f(s*(1),0,s*(0.5));
	glVertex3f(s*(0.9),0,s*(0.7));
	glVertex3f(s*(0.9),0,s*(0.8));
	glVertex3f(s*(1),0,s*(0.8));
	glVertex3f(s*(1),0,s*(0.7));
	glVertex3f(s*(0.9),0,s*(0.9));
	glVertex3f(s*(0.9),0,s*(1));
	glVertex3f(s*(1),0,s*(1));
	glVertex3f(s*(1),0,s*(0.9));
	glEnd();

	mat->glHalf();
	glBegin(GL_QUADS);
	glNormal3f(0,1,0);
	glVertex3f(s*(-1),0,s*(-0.9));
	glVertex3f(s*(-1),0,s*(-0.8));
	glVertex3f(s*(-0.9),0,s*(-0.8));
	glVertex3f(s*(-0.9),0,s*(-0.9));
	glVertex3f(s*(-1),0,s*(-0.7));
	glVertex3f(s*(-1),0,s*(-0.6));
	glVertex3f(s*(-0.9),0,s*(-0.6));
	glVertex3f(s*(-0.9),0,s*(-0.7));
	glVertex3f(s*(-1),0,s*(-0.5));
	glVertex3f(s*(-1),0,s*(-0.4));
	glVertex3f(s*(-0.9),0,s*(-0.4));
	glVertex3f(s*(-0.9),0,s*(-0.5));
	glVertex3f(s*(-1),0,s*(-0.3));
	glVertex3f(s*(-1),0,s*(-0.2));
	glVertex3f(s*(-0.9),0,s*(-0.2));
	glVertex3f(s*(-0.9),0,s*(-0.3));
	glVertex3f(s*(-1),0,s*(-0.1));
	glVertex3f(s*(-1),0,s*(0));
	glVertex3f(s*(-0.9),0,s*(0));
	glVertex3f(s*(-0.9),0,s*(-0.1));
	glVertex3f(s*(-1),0,s*(0.1));
	glVertex3f(s*(-1),0,s*(0.2));
	glVertex3f(s*(-0.9),0,s*(0.2));
	glVertex3f(s*(-0.9),0,s*(0.1));
	glVertex3f(s*(-1),0,s*(0.3));
	glVertex3f(s*(-1),0,s*(0.4));
	glVertex3f(s*(-0.9),0,s*(0.4));
	glVertex3f(s*(-0.9),0,s*(0.3));
	glVertex3f(s*(-1),0,s*(0.5));
	glVertex3f(s*(-1),0,s*(0.6));
	glVertex3f(s*(-0.9),0,s*(0.6));
	glVertex3f(s*(-0.9),0,s*(0.5));
	glVertex3f(s*(-1),0,s*(0.7));
	glVertex3f(s*(-1),0,s*(0.8));
	glVertex3f(s*(-0.9),0,s*(0.8));
	glVertex3f(s*(-0.9),0,s*(0.7));
	glVertex3f(s*(-1),0,s*(0.9));
	glVertex3f(s*(-1),0,s*(1));
	glVertex3f(s*(-0.9),0,s*(1));
	glVertex3f(s*(-0.9),0,s*(0.9));
	glVertex3f(s*(-0.9),0,s*(-1));
	glVertex3f(s*(-0.9),0,s*(-0.9));
	glVertex3f(s*(-0.8),0,s*(-0.9));
	glVertex3f(s*(-0.8),0,s*(-1));
	glVertex3f(s*(-0.9),0,s*(-0.8));
	glVertex3f(s*(-0.9),0,s*(-0.7));
	glVertex3f(s*(-0.8),0,s*(-0.7));
	glVertex3f(s*(-0.8),0,s*(-0.8));
	glVertex3f(s*(-0.9),0,s*(-0.6));
	glVertex3f(s*(-0.9),0,s*(-0.5));
	glVertex3f(s*(-0.8),0,s*(-0.5));
	glVertex3f(s*(-0.8),0,s*(-0.6));
	glVertex3f(s*(-0.9),0,s*(-0.4));
	glVertex3f(s*(-0.9),0,s*(-0.3));
	glVertex3f(s*(-0.8),0,s*(-0.3));
	glVertex3f(s*(-0.8),0,s*(-0.4));
	glVertex3f(s*(-0.9),0,s*(-0.2));
	glVertex3f(s*(-0.9),0,s*(-0.1));
	glVertex3f(s*(-0.8),0,s*(-0.1));
	glVertex3f(s*(-0.8),0,s*(-0.2));
	glVertex3f(s*(-0.9),0,s*(0));
	glVertex3f(s*(-0.9),0,s*(0.1));
	glVertex3f(s*(-0.8),0,s*(0.1));
	glVertex3f(s*(-0.8),0,s*(0));
	glVertex3f(s*(-0.9),0,s*(0.2));
	glVertex3f(s*(-0.9),0,s*(0.3));
	glVertex3f(s*(-0.8),0,s*(0.3));
	glVertex3f(s*(-0.8),0,s*(0.2));
	glVertex3f(s*(-0.9),0,s*(0.4));
	glVertex3f(s*(-0.9),0,s*(0.5));
	glVertex3f(s*(-0.8),0,s*(0.5));
	glVertex3f(s*(-0.8),0,s*(0.4));
	glVertex3f(s*(-0.9),0,s*(0.6));
	glVertex3f(s*(-0.9),0,s*(0.7));
	glVertex3f(s*(-0.8),0,s*(0.7));
	glVertex3f(s*(-0.8),0,s*(0.6));
	glVertex3f(s*(-0.9),0,s*(0.8));
	glVertex3f(s*(-0.9),0,s*(0.9));
	glVertex3f(s*(-0.8),0,s*(0.9));
	glVertex3f(s*(-0.8),0,s*(0.8));
	glVertex3f(s*(-0.8),0,s*(-0.9));
	glVertex3f(s*(-0.8),0,s*(-0.8));
	glVertex3f(s*(-0.7),0,s*(-0.8));
	glVertex3f(s*(-0.7),0,s*(-0.9));
	glVertex3f(s*(-0.8),0,s*(-0.7));
	glVertex3f(s*(-0.8),0,s*(-0.6));
	glVertex3f(s*(-0.7),0,s*(-0.6));
	glVertex3f(s*(-0.7),0,s*(-0.7));
	glVertex3f(s*(-0.8),0,s*(-0.5));
	glVertex3f(s*(-0.8),0,s*(-0.4));
	glVertex3f(s*(-0.7),0,s*(-0.4));
	glVertex3f(s*(-0.7),0,s*(-0.5));
	glVertex3f(s*(-0.8),0,s*(-0.3));
	glVertex3f(s*(-0.8),0,s*(-0.2));
	glVertex3f(s*(-0.7),0,s*(-0.2));
	glVertex3f(s*(-0.7),0,s*(-0.3));
	glVertex3f(s*(-0.8),0,s*(-0.1));
	glVertex3f(s*(-0.8),0,s*(0));
	glVertex3f(s*(-0.7),0,s*(0));
	glVertex3f(s*(-0.7),0,s*(-0.1));
	glVertex3f(s*(-0.8),0,s*(0.1));
	glVertex3f(s*(-0.8),0,s*(0.2));
	glVertex3f(s*(-0.7),0,s*(0.2));
	glVertex3f(s*(-0.7),0,s*(0.1));
	glVertex3f(s*(-0.8),0,s*(0.3));
	glVertex3f(s*(-0.8),0,s*(0.4));
	glVertex3f(s*(-0.7),0,s*(0.4));
	glVertex3f(s*(-0.7),0,s*(0.3));
	glVertex3f(s*(-0.8),0,s*(0.5));
	glVertex3f(s*(-0.8),0,s*(0.6));
	glVertex3f(s*(-0.7),0,s*(0.6));
	glVertex3f(s*(-0.7),0,s*(0.5));
	glVertex3f(s*(-0.8),0,s*(0.7));
	glVertex3f(s*(-0.8),0,s*(0.8));
	glVertex3f(s*(-0.7),0,s*(0.8));
	glVertex3f(s*(-0.7),0,s*(0.7));
	glVertex3f(s*(-0.8),0,s*(0.9));
	glVertex3f(s*(-0.8),0,s*(1));
	glVertex3f(s*(-0.7),0,s*(1));
	glVertex3f(s*(-0.7),0,s*(0.9));
	glVertex3f(s*(-0.7),0,s*(-1));
	glVertex3f(s*(-0.7),0,s*(-0.9));
	glVertex3f(s*(-0.6),0,s*(-0.9));
	glVertex3f(s*(-0.6),0,s*(-1));
	glVertex3f(s*(-0.7),0,s*(-0.8));
	glVertex3f(s*(-0.7),0,s*(-0.7));
	glVertex3f(s*(-0.6),0,s*(-0.7));
	glVertex3f(s*(-0.6),0,s*(-0.8));
	glVertex3f(s*(-0.7),0,s*(-0.6));
	glVertex3f(s*(-0.7),0,s*(-0.5));
	glVertex3f(s*(-0.6),0,s*(-0.5));
	glVertex3f(s*(-0.6),0,s*(-0.6));
	glVertex3f(s*(-0.7),0,s*(-0.4));
	glVertex3f(s*(-0.7),0,s*(-0.3));
	glVertex3f(s*(-0.6),0,s*(-0.3));
	glVertex3f(s*(-0.6),0,s*(-0.4));
	glVertex3f(s*(-0.7),0,s*(-0.2));
	glVertex3f(s*(-0.7),0,s*(-0.1));
	glVertex3f(s*(-0.6),0,s*(-0.1));
	glVertex3f(s*(-0.6),0,s*(-0.2));
	glVertex3f(s*(-0.7),0,s*(0));
	glVertex3f(s*(-0.7),0,s*(0.1));
	glVertex3f(s*(-0.6),0,s*(0.1));
	glVertex3f(s*(-0.6),0,s*(0));
	glVertex3f(s*(-0.7),0,s*(0.2));
	glVertex3f(s*(-0.7),0,s*(0.3));
	glVertex3f(s*(-0.6),0,s*(0.3));
	glVertex3f(s*(-0.6),0,s*(0.2));
	glVertex3f(s*(-0.7),0,s*(0.4));
	glVertex3f(s*(-0.7),0,s*(0.5));
	glVertex3f(s*(-0.6),0,s*(0.5));
	glVertex3f(s*(-0.6),0,s*(0.4));
	glVertex3f(s*(-0.7),0,s*(0.6));
	glVertex3f(s*(-0.7),0,s*(0.7));
	glVertex3f(s*(-0.6),0,s*(0.7));
	glVertex3f(s*(-0.6),0,s*(0.6));
	glVertex3f(s*(-0.7),0,s*(0.8));
	glVertex3f(s*(-0.7),0,s*(0.9));
	glVertex3f(s*(-0.6),0,s*(0.9));
	glVertex3f(s*(-0.6),0,s*(0.8));
	glVertex3f(s*(-0.6),0,s*(-0.9));
	glVertex3f(s*(-0.6),0,s*(-0.8));
	glVertex3f(s*(-0.5),0,s*(-0.8));
	glVertex3f(s*(-0.5),0,s*(-0.9));
	glVertex3f(s*(-0.6),0,s*(-0.7));
	glVertex3f(s*(-0.6),0,s*(-0.6));
	glVertex3f(s*(-0.5),0,s*(-0.6));
	glVertex3f(s*(-0.5),0,s*(-0.7));
	glVertex3f(s*(-0.6),0,s*(-0.5));
	glVertex3f(s*(-0.6),0,s*(-0.4));
	glVertex3f(s*(-0.5),0,s*(-0.4));
	glVertex3f(s*(-0.5),0,s*(-0.5));
	glVertex3f(s*(-0.6),0,s*(-0.3));
	glVertex3f(s*(-0.6),0,s*(-0.2));
	glVertex3f(s*(-0.5),0,s*(-0.2));
	glVertex3f(s*(-0.5),0,s*(-0.3));
	glVertex3f(s*(-0.6),0,s*(-0.1));
	glVertex3f(s*(-0.6),0,s*(0));
	glVertex3f(s*(-0.5),0,s*(0));
	glVertex3f(s*(-0.5),0,s*(-0.1));
	glVertex3f(s*(-0.6),0,s*(0.1));
	glVertex3f(s*(-0.6),0,s*(0.2));
	glVertex3f(s*(-0.5),0,s*(0.2));
	glVertex3f(s*(-0.5),0,s*(0.1));
	glVertex3f(s*(-0.6),0,s*(0.3));
	glVertex3f(s*(-0.6),0,s*(0.4));
	glVertex3f(s*(-0.5),0,s*(0.4));
	glVertex3f(s*(-0.5),0,s*(0.3));
	glVertex3f(s*(-0.6),0,s*(0.5));
	glVertex3f(s*(-0.6),0,s*(0.6));
	glVertex3f(s*(-0.5),0,s*(0.6));
	glVertex3f(s*(-0.5),0,s*(0.5));
	glVertex3f(s*(-0.6),0,s*(0.7));
	glVertex3f(s*(-0.6),0,s*(0.8));
	glVertex3f(s*(-0.5),0,s*(0.8));
	glVertex3f(s*(-0.5),0,s*(0.7));
	glVertex3f(s*(-0.6),0,s*(0.9));
	glVertex3f(s*(-0.6),0,s*(1));
	glVertex3f(s*(-0.5),0,s*(1));
	glVertex3f(s*(-0.5),0,s*(0.9));
	glVertex3f(s*(-0.5),0,s*(-1));
	glVertex3f(s*(-0.5),0,s*(-0.9));
	glVertex3f(s*(-0.4),0,s*(-0.9));
	glVertex3f(s*(-0.4),0,s*(-1));
	glVertex3f(s*(-0.5),0,s*(-0.8));
	glVertex3f(s*(-0.5),0,s*(-0.7));
	glVertex3f(s*(-0.4),0,s*(-0.7));
	glVertex3f(s*(-0.4),0,s*(-0.8));
	glVertex3f(s*(-0.5),0,s*(-0.6));
	glVertex3f(s*(-0.5),0,s*(-0.5));
	glVertex3f(s*(-0.4),0,s*(-0.5));
	glVertex3f(s*(-0.4),0,s*(-0.6));
	glVertex3f(s*(-0.5),0,s*(-0.4));
	glVertex3f(s*(-0.5),0,s*(-0.3));
	glVertex3f(s*(-0.4),0,s*(-0.3));
	glVertex3f(s*(-0.4),0,s*(-0.4));
	glVertex3f(s*(-0.5),0,s*(-0.2));
	glVertex3f(s*(-0.5),0,s*(-0.1));
	glVertex3f(s*(-0.4),0,s*(-0.1));
	glVertex3f(s*(-0.4),0,s*(-0.2));
	glVertex3f(s*(-0.5),0,s*(0));
	glVertex3f(s*(-0.5),0,s*(0.1));
	glVertex3f(s*(-0.4),0,s*(0.1));
	glVertex3f(s*(-0.4),0,s*(0));
	glVertex3f(s*(-0.5),0,s*(0.2));
	glVertex3f(s*(-0.5),0,s*(0.3));
	glVertex3f(s*(-0.4),0,s*(0.3));
	glVertex3f(s*(-0.4),0,s*(0.2));
	glVertex3f(s*(-0.5),0,s*(0.4));
	glVertex3f(s*(-0.5),0,s*(0.5));
	glVertex3f(s*(-0.4),0,s*(0.5));
	glVertex3f(s*(-0.4),0,s*(0.4));
	glVertex3f(s*(-0.5),0,s*(0.6));
	glVertex3f(s*(-0.5),0,s*(0.7));
	glVertex3f(s*(-0.4),0,s*(0.7));
	glVertex3f(s*(-0.4),0,s*(0.6));
	glVertex3f(s*(-0.5),0,s*(0.8));
	glVertex3f(s*(-0.5),0,s*(0.9));
	glVertex3f(s*(-0.4),0,s*(0.9));
	glVertex3f(s*(-0.4),0,s*(0.8));
	glVertex3f(s*(-0.4),0,s*(-0.9));
	glVertex3f(s*(-0.4),0,s*(-0.8));
	glVertex3f(s*(-0.3),0,s*(-0.8));
	glVertex3f(s*(-0.3),0,s*(-0.9));
	glVertex3f(s*(-0.4),0,s*(-0.7));
	glVertex3f(s*(-0.4),0,s*(-0.6));
	glVertex3f(s*(-0.3),0,s*(-0.6));
	glVertex3f(s*(-0.3),0,s*(-0.7));
	glVertex3f(s*(-0.4),0,s*(-0.5));
	glVertex3f(s*(-0.4),0,s*(-0.4));
	glVertex3f(s*(-0.3),0,s*(-0.4));
	glVertex3f(s*(-0.3),0,s*(-0.5));
	glVertex3f(s*(-0.4),0,s*(-0.3));
	glVertex3f(s*(-0.4),0,s*(-0.2));
	glVertex3f(s*(-0.3),0,s*(-0.2));
	glVertex3f(s*(-0.3),0,s*(-0.3));
	glVertex3f(s*(-0.4),0,s*(-0.1));
	glVertex3f(s*(-0.4),0,s*(0));
	glVertex3f(s*(-0.3),0,s*(0));
	glVertex3f(s*(-0.3),0,s*(-0.1));
	glVertex3f(s*(-0.4),0,s*(0.1));
	glVertex3f(s*(-0.4),0,s*(0.2));
	glVertex3f(s*(-0.3),0,s*(0.2));
	glVertex3f(s*(-0.3),0,s*(0.1));
	glVertex3f(s*(-0.4),0,s*(0.3));
	glVertex3f(s*(-0.4),0,s*(0.4));
	glVertex3f(s*(-0.3),0,s*(0.4));
	glVertex3f(s*(-0.3),0,s*(0.3));
	glVertex3f(s*(-0.4),0,s*(0.5));
	glVertex3f(s*(-0.4),0,s*(0.6));
	glVertex3f(s*(-0.3),0,s*(0.6));
	glVertex3f(s*(-0.3),0,s*(0.5));
	glVertex3f(s*(-0.4),0,s*(0.7));
	glVertex3f(s*(-0.4),0,s*(0.8));
	glVertex3f(s*(-0.3),0,s*(0.8));
	glVertex3f(s*(-0.3),0,s*(0.7));
	glVertex3f(s*(-0.4),0,s*(0.9));
	glVertex3f(s*(-0.4),0,s*(1));
	glVertex3f(s*(-0.3),0,s*(1));
	glVertex3f(s*(-0.3),0,s*(0.9));
	glVertex3f(s*(-0.3),0,s*(-1));
	glVertex3f(s*(-0.3),0,s*(-0.9));
	glVertex3f(s*(-0.2),0,s*(-0.9));
	glVertex3f(s*(-0.2),0,s*(-1));
	glVertex3f(s*(-0.3),0,s*(-0.8));
	glVertex3f(s*(-0.3),0,s*(-0.7));
	glVertex3f(s*(-0.2),0,s*(-0.7));
	glVertex3f(s*(-0.2),0,s*(-0.8));
	glVertex3f(s*(-0.3),0,s*(-0.6));
	glVertex3f(s*(-0.3),0,s*(-0.5));
	glVertex3f(s*(-0.2),0,s*(-0.5));
	glVertex3f(s*(-0.2),0,s*(-0.6));
	glVertex3f(s*(-0.3),0,s*(-0.4));
	glVertex3f(s*(-0.3),0,s*(-0.3));
	glVertex3f(s*(-0.2),0,s*(-0.3));
	glVertex3f(s*(-0.2),0,s*(-0.4));
	glVertex3f(s*(-0.3),0,s*(-0.2));
	glVertex3f(s*(-0.3),0,s*(-0.1));
	glVertex3f(s*(-0.2),0,s*(-0.1));
	glVertex3f(s*(-0.2),0,s*(-0.2));
	glVertex3f(s*(-0.3),0,s*(0));
	glVertex3f(s*(-0.3),0,s*(0.1));
	glVertex3f(s*(-0.2),0,s*(0.1));
	glVertex3f(s*(-0.2),0,s*(0));
	glVertex3f(s*(-0.3),0,s*(0.2));
	glVertex3f(s*(-0.3),0,s*(0.3));
	glVertex3f(s*(-0.2),0,s*(0.3));
	glVertex3f(s*(-0.2),0,s*(0.2));
	glVertex3f(s*(-0.3),0,s*(0.4));
	glVertex3f(s*(-0.3),0,s*(0.5));
	glVertex3f(s*(-0.2),0,s*(0.5));
	glVertex3f(s*(-0.2),0,s*(0.4));
	glVertex3f(s*(-0.3),0,s*(0.6));
	glVertex3f(s*(-0.3),0,s*(0.7));
	glVertex3f(s*(-0.2),0,s*(0.7));
	glVertex3f(s*(-0.2),0,s*(0.6));
	glVertex3f(s*(-0.3),0,s*(0.8));
	glVertex3f(s*(-0.3),0,s*(0.9));
	glVertex3f(s*(-0.2),0,s*(0.9));
	glVertex3f(s*(-0.2),0,s*(0.8));
	glVertex3f(s*(-0.2),0,s*(-0.9));
	glVertex3f(s*(-0.2),0,s*(-0.8));
	glVertex3f(s*(-0.1),0,s*(-0.8));
	glVertex3f(s*(-0.1),0,s*(-0.9));
	glVertex3f(s*(-0.2),0,s*(-0.7));
	glVertex3f(s*(-0.2),0,s*(-0.6));
	glVertex3f(s*(-0.1),0,s*(-0.6));
	glVertex3f(s*(-0.1),0,s*(-0.7));
	glVertex3f(s*(-0.2),0,s*(-0.5));
	glVertex3f(s*(-0.2),0,s*(-0.4));
	glVertex3f(s*(-0.1),0,s*(-0.4));
	glVertex3f(s*(-0.1),0,s*(-0.5));
	glVertex3f(s*(-0.2),0,s*(-0.3));
	glVertex3f(s*(-0.2),0,s*(-0.2));
	glVertex3f(s*(-0.1),0,s*(-0.2));
	glVertex3f(s*(-0.1),0,s*(-0.3));
	glVertex3f(s*(-0.2),0,s*(-0.1));
	glVertex3f(s*(-0.2),0,s*(0));
	glVertex3f(s*(-0.1),0,s*(0));
	glVertex3f(s*(-0.1),0,s*(-0.1));
	glVertex3f(s*(-0.2),0,s*(0.1));
	glVertex3f(s*(-0.2),0,s*(0.2));
	glVertex3f(s*(-0.1),0,s*(0.2));
	glVertex3f(s*(-0.1),0,s*(0.1));
	glVertex3f(s*(-0.2),0,s*(0.3));
	glVertex3f(s*(-0.2),0,s*(0.4));
	glVertex3f(s*(-0.1),0,s*(0.4));
	glVertex3f(s*(-0.1),0,s*(0.3));
	glVertex3f(s*(-0.2),0,s*(0.5));
	glVertex3f(s*(-0.2),0,s*(0.6));
	glVertex3f(s*(-0.1),0,s*(0.6));
	glVertex3f(s*(-0.1),0,s*(0.5));
	glVertex3f(s*(-0.2),0,s*(0.7));
	glVertex3f(s*(-0.2),0,s*(0.8));
	glVertex3f(s*(-0.1),0,s*(0.8));
	glVertex3f(s*(-0.1),0,s*(0.7));
	glVertex3f(s*(-0.2),0,s*(0.9));
	glVertex3f(s*(-0.2),0,s*(1));
	glVertex3f(s*(-0.1),0,s*(1));
	glVertex3f(s*(-0.1),0,s*(0.9));
	glVertex3f(s*(-0.1),0,s*(-1));
	glVertex3f(s*(-0.1),0,s*(-0.9));
	glVertex3f(s*(0),0,s*(-0.9));
	glVertex3f(s*(0),0,s*(-1));
	glVertex3f(s*(-0.1),0,s*(-0.8));
	glVertex3f(s*(-0.1),0,s*(-0.7));
	glVertex3f(s*(0),0,s*(-0.7));
	glVertex3f(s*(0),0,s*(-0.8));
	glVertex3f(s*(-0.1),0,s*(-0.6));
	glVertex3f(s*(-0.1),0,s*(-0.5));
	glVertex3f(s*(0),0,s*(-0.5));
	glVertex3f(s*(0),0,s*(-0.6));
	glVertex3f(s*(-0.1),0,s*(-0.4));
	glVertex3f(s*(-0.1),0,s*(-0.3));
	glVertex3f(s*(0),0,s*(-0.3));
	glVertex3f(s*(0),0,s*(-0.4));
	glVertex3f(s*(-0.1),0,s*(-0.2));
	glVertex3f(s*(-0.1),0,s*(-0.1));
	glVertex3f(s*(0),0,s*(-0.1));
	glVertex3f(s*(0),0,s*(-0.2));
	glVertex3f(s*(-0.1),0,s*(0));
	glVertex3f(s*(-0.1),0,s*(0.1));
	glVertex3f(s*(0),0,s*(0.1));
	glVertex3f(s*(0),0,s*(0));
	glVertex3f(s*(-0.1),0,s*(0.2));
	glVertex3f(s*(-0.1),0,s*(0.3));
	glVertex3f(s*(0),0,s*(0.3));
	glVertex3f(s*(0),0,s*(0.2));
	glVertex3f(s*(-0.1),0,s*(0.4));
	glVertex3f(s*(-0.1),0,s*(0.5));
	glVertex3f(s*(0),0,s*(0.5));
	glVertex3f(s*(0),0,s*(0.4));
	glVertex3f(s*(-0.1),0,s*(0.6));
	glVertex3f(s*(-0.1),0,s*(0.7));
	glVertex3f(s*(0),0,s*(0.7));
	glVertex3f(s*(0),0,s*(0.6));
	glVertex3f(s*(-0.1),0,s*(0.8));
	glVertex3f(s*(-0.1),0,s*(0.9));
	glVertex3f(s*(0),0,s*(0.9));
	glVertex3f(s*(0),0,s*(0.8));
	glVertex3f(s*(0),0,s*(-0.9));
	glVertex3f(s*(0),0,s*(-0.8));
	glVertex3f(s*(0.1),0,s*(-0.8));
	glVertex3f(s*(0.1),0,s*(-0.9));
	glVertex3f(s*(0),0,s*(-0.7));
	glVertex3f(s*(0),0,s*(-0.6));
	glVertex3f(s*(0.1),0,s*(-0.6));
	glVertex3f(s*(0.1),0,s*(-0.7));
	glVertex3f(s*(0),0,s*(-0.5));
	glVertex3f(s*(0),0,s*(-0.4));
	glVertex3f(s*(0.1),0,s*(-0.4));
	glVertex3f(s*(0.1),0,s*(-0.5));
	glVertex3f(s*(0),0,s*(-0.3));
	glVertex3f(s*(0),0,s*(-0.2));
	glVertex3f(s*(0.1),0,s*(-0.2));
	glVertex3f(s*(0.1),0,s*(-0.3));
	glVertex3f(s*(0),0,s*(-0.1));
	glVertex3f(s*(0),0,s*(0));
	glVertex3f(s*(0.1),0,s*(0));
	glVertex3f(s*(0.1),0,s*(-0.1));
	glVertex3f(s*(0),0,s*(0.1));
	glVertex3f(s*(0),0,s*(0.2));
	glVertex3f(s*(0.1),0,s*(0.2));
	glVertex3f(s*(0.1),0,s*(0.1));
	glVertex3f(s*(0),0,s*(0.3));
	glVertex3f(s*(0),0,s*(0.4));
	glVertex3f(s*(0.1),0,s*(0.4));
	glVertex3f(s*(0.1),0,s*(0.3));
	glVertex3f(s*(0),0,s*(0.5));
	glVertex3f(s*(0),0,s*(0.6));
	glVertex3f(s*(0.1),0,s*(0.6));
	glVertex3f(s*(0.1),0,s*(0.5));
	glVertex3f(s*(0),0,s*(0.7));
	glVertex3f(s*(0),0,s*(0.8));
	glVertex3f(s*(0.1),0,s*(0.8));
	glVertex3f(s*(0.1),0,s*(0.7));
	glVertex3f(s*(0),0,s*(0.9));
	glVertex3f(s*(0),0,s*(1));
	glVertex3f(s*(0.1),0,s*(1));
	glVertex3f(s*(0.1),0,s*(0.9));
	glVertex3f(s*(0.1),0,s*(-1));
	glVertex3f(s*(0.1),0,s*(-0.9));
	glVertex3f(s*(0.2),0,s*(-0.9));
	glVertex3f(s*(0.2),0,s*(-1));
	glVertex3f(s*(0.1),0,s*(-0.8));
	glVertex3f(s*(0.1),0,s*(-0.7));
	glVertex3f(s*(0.2),0,s*(-0.7));
	glVertex3f(s*(0.2),0,s*(-0.8));
	glVertex3f(s*(0.1),0,s*(-0.6));
	glVertex3f(s*(0.1),0,s*(-0.5));
	glVertex3f(s*(0.2),0,s*(-0.5));
	glVertex3f(s*(0.2),0,s*(-0.6));
	glVertex3f(s*(0.1),0,s*(-0.4));
	glVertex3f(s*(0.1),0,s*(-0.3));
	glVertex3f(s*(0.2),0,s*(-0.3));
	glVertex3f(s*(0.2),0,s*(-0.4));
	glVertex3f(s*(0.1),0,s*(-0.2));
	glVertex3f(s*(0.1),0,s*(-0.1));
	glVertex3f(s*(0.2),0,s*(-0.1));
	glVertex3f(s*(0.2),0,s*(-0.2));
	glVertex3f(s*(0.1),0,s*(0));
	glVertex3f(s*(0.1),0,s*(0.1));
	glVertex3f(s*(0.2),0,s*(0.1));
	glVertex3f(s*(0.2),0,s*(0));
	glVertex3f(s*(0.1),0,s*(0.2));
	glVertex3f(s*(0.1),0,s*(0.3));
	glVertex3f(s*(0.2),0,s*(0.3));
	glVertex3f(s*(0.2),0,s*(0.2));
	glVertex3f(s*(0.1),0,s*(0.4));
	glVertex3f(s*(0.1),0,s*(0.5));
	glVertex3f(s*(0.2),0,s*(0.5));
	glVertex3f(s*(0.2),0,s*(0.4));
	glVertex3f(s*(0.1),0,s*(0.6));
	glVertex3f(s*(0.1),0,s*(0.7));
	glVertex3f(s*(0.2),0,s*(0.7));
	glVertex3f(s*(0.2),0,s*(0.6));
	glVertex3f(s*(0.1),0,s*(0.8));
	glVertex3f(s*(0.1),0,s*(0.9));
	glVertex3f(s*(0.2),0,s*(0.9));
	glVertex3f(s*(0.2),0,s*(0.8));
	glVertex3f(s*(0.2),0,s*(-0.9));
	glVertex3f(s*(0.2),0,s*(-0.8));
	glVertex3f(s*(0.3),0,s*(-0.8));
	glVertex3f(s*(0.3),0,s*(-0.9));
	glVertex3f(s*(0.2),0,s*(-0.7));
	glVertex3f(s*(0.2),0,s*(-0.6));
	glVertex3f(s*(0.3),0,s*(-0.6));
	glVertex3f(s*(0.3),0,s*(-0.7));
	glVertex3f(s*(0.2),0,s*(-0.5));
	glVertex3f(s*(0.2),0,s*(-0.4));
	glVertex3f(s*(0.3),0,s*(-0.4));
	glVertex3f(s*(0.3),0,s*(-0.5));
	glVertex3f(s*(0.2),0,s*(-0.3));
	glVertex3f(s*(0.2),0,s*(-0.2));
	glVertex3f(s*(0.3),0,s*(-0.2));
	glVertex3f(s*(0.3),0,s*(-0.3));
	glVertex3f(s*(0.2),0,s*(-0.1));
	glVertex3f(s*(0.2),0,s*(0));
	glVertex3f(s*(0.3),0,s*(0));
	glVertex3f(s*(0.3),0,s*(-0.1));
	glVertex3f(s*(0.2),0,s*(0.1));
	glVertex3f(s*(0.2),0,s*(0.2));
	glVertex3f(s*(0.3),0,s*(0.2));
	glVertex3f(s*(0.3),0,s*(0.1));
	glVertex3f(s*(0.2),0,s*(0.3));
	glVertex3f(s*(0.2),0,s*(0.4));
	glVertex3f(s*(0.3),0,s*(0.4));
	glVertex3f(s*(0.3),0,s*(0.3));
	glVertex3f(s*(0.2),0,s*(0.5));
	glVertex3f(s*(0.2),0,s*(0.6));
	glVertex3f(s*(0.3),0,s*(0.6));
	glVertex3f(s*(0.3),0,s*(0.5));
	glVertex3f(s*(0.2),0,s*(0.7));
	glVertex3f(s*(0.2),0,s*(0.8));
	glVertex3f(s*(0.3),0,s*(0.8));
	glVertex3f(s*(0.3),0,s*(0.7));
	glVertex3f(s*(0.2),0,s*(0.9));
	glVertex3f(s*(0.2),0,s*(1));
	glVertex3f(s*(0.3),0,s*(1));
	glVertex3f(s*(0.3),0,s*(0.9));
	glVertex3f(s*(0.3),0,s*(-1));
	glVertex3f(s*(0.3),0,s*(-0.9));
	glVertex3f(s*(0.4),0,s*(-0.9));
	glVertex3f(s*(0.4),0,s*(-1));
	glVertex3f(s*(0.3),0,s*(-0.8));
	glVertex3f(s*(0.3),0,s*(-0.7));
	glVertex3f(s*(0.4),0,s*(-0.7));
	glVertex3f(s*(0.4),0,s*(-0.8));
	glVertex3f(s*(0.3),0,s*(-0.6));
	glVertex3f(s*(0.3),0,s*(-0.5));
	glVertex3f(s*(0.4),0,s*(-0.5));
	glVertex3f(s*(0.4),0,s*(-0.6));
	glVertex3f(s*(0.3),0,s*(-0.4));
	glVertex3f(s*(0.3),0,s*(-0.3));
	glVertex3f(s*(0.4),0,s*(-0.3));
	glVertex3f(s*(0.4),0,s*(-0.4));
	glVertex3f(s*(0.3),0,s*(-0.2));
	glVertex3f(s*(0.3),0,s*(-0.1));
	glVertex3f(s*(0.4),0,s*(-0.1));
	glVertex3f(s*(0.4),0,s*(-0.2));
	glVertex3f(s*(0.3),0,s*(0));
	glVertex3f(s*(0.3),0,s*(0.1));
	glVertex3f(s*(0.4),0,s*(0.1));
	glVertex3f(s*(0.4),0,s*(0));
	glVertex3f(s*(0.3),0,s*(0.2));
	glVertex3f(s*(0.3),0,s*(0.3));
	glVertex3f(s*(0.4),0,s*(0.3));
	glVertex3f(s*(0.4),0,s*(0.2));
	glVertex3f(s*(0.3),0,s*(0.4));
	glVertex3f(s*(0.3),0,s*(0.5));
	glVertex3f(s*(0.4),0,s*(0.5));
	glVertex3f(s*(0.4),0,s*(0.4));
	glVertex3f(s*(0.3),0,s*(0.6));
	glVertex3f(s*(0.3),0,s*(0.7));
	glVertex3f(s*(0.4),0,s*(0.7));
	glVertex3f(s*(0.4),0,s*(0.6));
	glVertex3f(s*(0.3),0,s*(0.8));
	glVertex3f(s*(0.3),0,s*(0.9));
	glVertex3f(s*(0.4),0,s*(0.9));
	glVertex3f(s*(0.4),0,s*(0.8));
	glVertex3f(s*(0.4),0,s*(-0.9));
	glVertex3f(s*(0.4),0,s*(-0.8));
	glVertex3f(s*(0.5),0,s*(-0.8));
	glVertex3f(s*(0.5),0,s*(-0.9));
	glVertex3f(s*(0.4),0,s*(-0.7));
	glVertex3f(s*(0.4),0,s*(-0.6));
	glVertex3f(s*(0.5),0,s*(-0.6));
	glVertex3f(s*(0.5),0,s*(-0.7));
	glVertex3f(s*(0.4),0,s*(-0.5));
	glVertex3f(s*(0.4),0,s*(-0.4));
	glVertex3f(s*(0.5),0,s*(-0.4));
	glVertex3f(s*(0.5),0,s*(-0.5));
	glVertex3f(s*(0.4),0,s*(-0.3));
	glVertex3f(s*(0.4),0,s*(-0.2));
	glVertex3f(s*(0.5),0,s*(-0.2));
	glVertex3f(s*(0.5),0,s*(-0.3));
	glVertex3f(s*(0.4),0,s*(-0.1));
	glVertex3f(s*(0.4),0,s*(0));
	glVertex3f(s*(0.5),0,s*(0));
	glVertex3f(s*(0.5),0,s*(-0.1));
	glVertex3f(s*(0.4),0,s*(0.1));
	glVertex3f(s*(0.4),0,s*(0.2));
	glVertex3f(s*(0.5),0,s*(0.2));
	glVertex3f(s*(0.5),0,s*(0.1));
	glVertex3f(s*(0.4),0,s*(0.3));
	glVertex3f(s*(0.4),0,s*(0.4));
	glVertex3f(s*(0.5),0,s*(0.4));
	glVertex3f(s*(0.5),0,s*(0.3));
	glVertex3f(s*(0.4),0,s*(0.5));
	glVertex3f(s*(0.4),0,s*(0.6));
	glVertex3f(s*(0.5),0,s*(0.6));
	glVertex3f(s*(0.5),0,s*(0.5));
	glVertex3f(s*(0.4),0,s*(0.7));
	glVertex3f(s*(0.4),0,s*(0.8));
	glVertex3f(s*(0.5),0,s*(0.8));
	glVertex3f(s*(0.5),0,s*(0.7));
	glVertex3f(s*(0.4),0,s*(0.9));
	glVertex3f(s*(0.4),0,s*(1));
	glVertex3f(s*(0.5),0,s*(1));
	glVertex3f(s*(0.5),0,s*(0.9));
	glVertex3f(s*(0.5),0,s*(-1));
	glVertex3f(s*(0.5),0,s*(-0.9));
	glVertex3f(s*(0.6),0,s*(-0.9));
	glVertex3f(s*(0.6),0,s*(-1));
	glVertex3f(s*(0.5),0,s*(-0.8));
	glVertex3f(s*(0.5),0,s*(-0.7));
	glVertex3f(s*(0.6),0,s*(-0.7));
	glVertex3f(s*(0.6),0,s*(-0.8));
	glVertex3f(s*(0.5),0,s*(-0.6));
	glVertex3f(s*(0.5),0,s*(-0.5));
	glVertex3f(s*(0.6),0,s*(-0.5));
	glVertex3f(s*(0.6),0,s*(-0.6));
	glVertex3f(s*(0.5),0,s*(-0.4));
	glVertex3f(s*(0.5),0,s*(-0.3));
	glVertex3f(s*(0.6),0,s*(-0.3));
	glVertex3f(s*(0.6),0,s*(-0.4));
	glVertex3f(s*(0.5),0,s*(-0.2));
	glVertex3f(s*(0.5),0,s*(-0.1));
	glVertex3f(s*(0.6),0,s*(-0.1));
	glVertex3f(s*(0.6),0,s*(-0.2));
	glVertex3f(s*(0.5),0,s*(0));
	glVertex3f(s*(0.5),0,s*(0.1));
	glVertex3f(s*(0.6),0,s*(0.1));
	glVertex3f(s*(0.6),0,s*(0));
	glVertex3f(s*(0.5),0,s*(0.2));
	glVertex3f(s*(0.5),0,s*(0.3));
	glVertex3f(s*(0.6),0,s*(0.3));
	glVertex3f(s*(0.6),0,s*(0.2));
	glVertex3f(s*(0.5),0,s*(0.4));
	glVertex3f(s*(0.5),0,s*(0.5));
	glVertex3f(s*(0.6),0,s*(0.5));
	glVertex3f(s*(0.6),0,s*(0.4));
	glVertex3f(s*(0.5),0,s*(0.6));
	glVertex3f(s*(0.5),0,s*(0.7));
	glVertex3f(s*(0.6),0,s*(0.7));
	glVertex3f(s*(0.6),0,s*(0.6));
	glVertex3f(s*(0.5),0,s*(0.8));
	glVertex3f(s*(0.5),0,s*(0.9));
	glVertex3f(s*(0.6),0,s*(0.9));
	glVertex3f(s*(0.6),0,s*(0.8));
	glVertex3f(s*(0.6),0,s*(-0.9));
	glVertex3f(s*(0.6),0,s*(-0.8));
	glVertex3f(s*(0.7),0,s*(-0.8));
	glVertex3f(s*(0.7),0,s*(-0.9));
	glVertex3f(s*(0.6),0,s*(-0.7));
	glVertex3f(s*(0.6),0,s*(-0.6));
	glVertex3f(s*(0.7),0,s*(-0.6));
	glVertex3f(s*(0.7),0,s*(-0.7));
	glVertex3f(s*(0.6),0,s*(-0.5));
	glVertex3f(s*(0.6),0,s*(-0.4));
	glVertex3f(s*(0.7),0,s*(-0.4));
	glVertex3f(s*(0.7),0,s*(-0.5));
	glVertex3f(s*(0.6),0,s*(-0.3));
	glVertex3f(s*(0.6),0,s*(-0.2));
	glVertex3f(s*(0.7),0,s*(-0.2));
	glVertex3f(s*(0.7),0,s*(-0.3));
	glVertex3f(s*(0.6),0,s*(-0.1));
	glVertex3f(s*(0.6),0,s*(0));
	glVertex3f(s*(0.7),0,s*(0));
	glVertex3f(s*(0.7),0,s*(-0.1));
	glVertex3f(s*(0.6),0,s*(0.1));
	glVertex3f(s*(0.6),0,s*(0.2));
	glVertex3f(s*(0.7),0,s*(0.2));
	glVertex3f(s*(0.7),0,s*(0.1));
	glVertex3f(s*(0.6),0,s*(0.3));
	glVertex3f(s*(0.6),0,s*(0.4));
	glVertex3f(s*(0.7),0,s*(0.4));
	glVertex3f(s*(0.7),0,s*(0.3));
	glVertex3f(s*(0.6),0,s*(0.5));
	glVertex3f(s*(0.6),0,s*(0.6));
	glVertex3f(s*(0.7),0,s*(0.6));
	glVertex3f(s*(0.7),0,s*(0.5));
	glVertex3f(s*(0.6),0,s*(0.7));
	glVertex3f(s*(0.6),0,s*(0.8));
	glVertex3f(s*(0.7),0,s*(0.8));
	glVertex3f(s*(0.7),0,s*(0.7));
	glVertex3f(s*(0.6),0,s*(0.9));
	glVertex3f(s*(0.6),0,s*(1));
	glVertex3f(s*(0.7),0,s*(1));
	glVertex3f(s*(0.7),0,s*(0.9));
	glVertex3f(s*(0.7),0,s*(-1));
	glVertex3f(s*(0.7),0,s*(-0.9));
	glVertex3f(s*(0.8),0,s*(-0.9));
	glVertex3f(s*(0.8),0,s*(-1));
	glVertex3f(s*(0.7),0,s*(-0.8));
	glVertex3f(s*(0.7),0,s*(-0.7));
	glVertex3f(s*(0.8),0,s*(-0.7));
	glVertex3f(s*(0.8),0,s*(-0.8));
	glVertex3f(s*(0.7),0,s*(-0.6));
	glVertex3f(s*(0.7),0,s*(-0.5));
	glVertex3f(s*(0.8),0,s*(-0.5));
	glVertex3f(s*(0.8),0,s*(-0.6));
	glVertex3f(s*(0.7),0,s*(-0.4));
	glVertex3f(s*(0.7),0,s*(-0.3));
	glVertex3f(s*(0.8),0,s*(-0.3));
	glVertex3f(s*(0.8),0,s*(-0.4));
	glVertex3f(s*(0.7),0,s*(-0.2));
	glVertex3f(s*(0.7),0,s*(-0.1));
	glVertex3f(s*(0.8),0,s*(-0.1));
	glVertex3f(s*(0.8),0,s*(-0.2));
	glVertex3f(s*(0.7),0,s*(0));
	glVertex3f(s*(0.7),0,s*(0.1));
	glVertex3f(s*(0.8),0,s*(0.1));
	glVertex3f(s*(0.8),0,s*(0));
	glVertex3f(s*(0.7),0,s*(0.2));
	glVertex3f(s*(0.7),0,s*(0.3));
	glVertex3f(s*(0.8),0,s*(0.3));
	glVertex3f(s*(0.8),0,s*(0.2));
	glVertex3f(s*(0.7),0,s*(0.4));
	glVertex3f(s*(0.7),0,s*(0.5));
	glVertex3f(s*(0.8),0,s*(0.5));
	glVertex3f(s*(0.8),0,s*(0.4));
	glVertex3f(s*(0.7),0,s*(0.6));
	glVertex3f(s*(0.7),0,s*(0.7));
	glVertex3f(s*(0.8),0,s*(0.7));
	glVertex3f(s*(0.8),0,s*(0.6));
	glVertex3f(s*(0.7),0,s*(0.8));
	glVertex3f(s*(0.7),0,s*(0.9));
	glVertex3f(s*(0.8),0,s*(0.9));
	glVertex3f(s*(0.8),0,s*(0.8));
	glVertex3f(s*(0.8),0,s*(-0.9));
	glVertex3f(s*(0.8),0,s*(-0.8));
	glVertex3f(s*(0.9),0,s*(-0.8));
	glVertex3f(s*(0.9),0,s*(-0.9));
	glVertex3f(s*(0.8),0,s*(-0.7));
	glVertex3f(s*(0.8),0,s*(-0.6));
	glVertex3f(s*(0.9),0,s*(-0.6));
	glVertex3f(s*(0.9),0,s*(-0.7));
	glVertex3f(s*(0.8),0,s*(-0.5));
	glVertex3f(s*(0.8),0,s*(-0.4));
	glVertex3f(s*(0.9),0,s*(-0.4));
	glVertex3f(s*(0.9),0,s*(-0.5));
	glVertex3f(s*(0.8),0,s*(-0.3));
	glVertex3f(s*(0.8),0,s*(-0.2));
	glVertex3f(s*(0.9),0,s*(-0.2));
	glVertex3f(s*(0.9),0,s*(-0.3));
	glVertex3f(s*(0.8),0,s*(-0.1));
	glVertex3f(s*(0.8),0,s*(0));
	glVertex3f(s*(0.9),0,s*(0));
	glVertex3f(s*(0.9),0,s*(-0.1));
	glVertex3f(s*(0.8),0,s*(0.1));
	glVertex3f(s*(0.8),0,s*(0.2));
	glVertex3f(s*(0.9),0,s*(0.2));
	glVertex3f(s*(0.9),0,s*(0.1));
	glVertex3f(s*(0.8),0,s*(0.3));
	glVertex3f(s*(0.8),0,s*(0.4));
	glVertex3f(s*(0.9),0,s*(0.4));
	glVertex3f(s*(0.9),0,s*(0.3));
	glVertex3f(s*(0.8),0,s*(0.5));
	glVertex3f(s*(0.8),0,s*(0.6));
	glVertex3f(s*(0.9),0,s*(0.6));
	glVertex3f(s*(0.9),0,s*(0.5));
	glVertex3f(s*(0.8),0,s*(0.7));
	glVertex3f(s*(0.8),0,s*(0.8));
	glVertex3f(s*(0.9),0,s*(0.8));
	glVertex3f(s*(0.9),0,s*(0.7));
	glVertex3f(s*(0.8),0,s*(0.9));
	glVertex3f(s*(0.8),0,s*(1));
	glVertex3f(s*(0.9),0,s*(1));
	glVertex3f(s*(0.9),0,s*(0.9));
	glVertex3f(s*(0.9),0,s*(-1));
	glVertex3f(s*(0.9),0,s*(-0.9));
	glVertex3f(s*(1),0,s*(-0.9));
	glVertex3f(s*(1),0,s*(-1));
	glVertex3f(s*(0.9),0,s*(-0.8));
	glVertex3f(s*(0.9),0,s*(-0.7));
	glVertex3f(s*(1),0,s*(-0.7));
	glVertex3f(s*(1),0,s*(-0.8));
	glVertex3f(s*(0.9),0,s*(-0.6));
	glVertex3f(s*(0.9),0,s*(-0.5));
	glVertex3f(s*(1),0,s*(-0.5));
	glVertex3f(s*(1),0,s*(-0.6));
	glVertex3f(s*(0.9),0,s*(-0.4));
	glVertex3f(s*(0.9),0,s*(-0.3));
	glVertex3f(s*(1),0,s*(-0.3));
	glVertex3f(s*(1),0,s*(-0.4));
	glVertex3f(s*(0.9),0,s*(-0.2));
	glVertex3f(s*(0.9),0,s*(-0.1));
	glVertex3f(s*(1),0,s*(-0.1));
	glVertex3f(s*(1),0,s*(-0.2));
	glVertex3f(s*(0.9),0,s*(0));
	glVertex3f(s*(0.9),0,s*(0.1));
	glVertex3f(s*(1),0,s*(0.1));
	glVertex3f(s*(1),0,s*(0));
	glVertex3f(s*(0.9),0,s*(0.2));
	glVertex3f(s*(0.9),0,s*(0.3));
	glVertex3f(s*(1),0,s*(0.3));
	glVertex3f(s*(1),0,s*(0.2));
	glVertex3f(s*(0.9),0,s*(0.4));
	glVertex3f(s*(0.9),0,s*(0.5));
	glVertex3f(s*(1),0,s*(0.5));
	glVertex3f(s*(1),0,s*(0.4));
	glVertex3f(s*(0.9),0,s*(0.6));
	glVertex3f(s*(0.9),0,s*(0.7));
	glVertex3f(s*(1),0,s*(0.7));
	glVertex3f(s*(1),0,s*(0.6));
	glVertex3f(s*(0.9),0,s*(0.8));
	glVertex3f(s*(0.9),0,s*(0.9));
	glVertex3f(s*(1),0,s*(0.9));
	glVertex3f(s*(1),0,s*(0.8));
	glEnd();
}

void GLPrimitive::circle(float r, Material *mat, Matrix4f *t){
	glPushMatrix(); 
	float transform[16]; 
	t->get(transform); 
	glMultMatrixf(transform); 
	//PARAM: r : ray

if(mat!=NULL){

	mat->gl();

}
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0,1);
	glVertex3f(r*(1),r*(0),0);
	glVertex3f(r*(0.984808),r*(0.173648),0);
	glVertex3f(r*(0.939693),r*(0.34202),0);
	glVertex3f(r*(0.866025),r*(0.5),0);
	glVertex3f(r*(0.766044),r*(0.642788),0);
	glVertex3f(r*(0.642788),r*(0.766044),0);
	glVertex3f(r*(0.5),r*(0.866025),0);
	glVertex3f(r*(0.34202),r*(0.939693),0);
	glVertex3f(r*(0.173648),r*(0.984808),0);
	glVertex3f(r*(6.12323e-17),r*(1),0);
	glVertex3f(r*(-0.173648),r*(0.984808),0);
	glVertex3f(r*(-0.34202),r*(0.939693),0);
	glVertex3f(r*(-0.5),r*(0.866025),0);
	glVertex3f(r*(-0.642788),r*(0.766044),0);
	glVertex3f(r*(-0.766044),r*(0.642788),0);
	glVertex3f(r*(-0.866025),r*(0.5),0);
	glVertex3f(r*(-0.939693),r*(0.34202),0);
	glVertex3f(r*(-0.984808),r*(0.173648),0);
	glVertex3f(r*(-1),r*(1.22465e-16),0);
	glVertex3f(r*(-0.984808),r*(-0.173648),0);
	glVertex3f(r*(-0.939693),r*(-0.34202),0);
	glVertex3f(r*(-0.866025),r*(-0.5),0);
	glVertex3f(r*(-0.766044),r*(-0.642788),0);
	glVertex3f(r*(-0.642788),r*(-0.766044),0);
	glVertex3f(r*(-0.5),r*(-0.866025),0);
	glVertex3f(r*(-0.34202),r*(-0.939693),0);
	glVertex3f(r*(-0.173648),r*(-0.984808),0);
	glVertex3f(r*(-1.83697e-16),r*(-1),0);
	glVertex3f(r*(0.173648),r*(-0.984808),0);
	glVertex3f(r*(0.34202),r*(-0.939693),0);
	glVertex3f(r*(0.5),r*(-0.866025),0);
	glVertex3f(r*(0.642788),r*(-0.766044),0);
	glVertex3f(r*(0.766044),r*(-0.642788),0);
	glVertex3f(r*(0.866025),r*(-0.5),0);
	glVertex3f(r*(0.939693),r*(-0.34202),0);
	glVertex3f(r*(0.984808),r*(-0.173648),0);
	glVertex3f(r*(1),r*(0),0);
	glEnd();
	glPopMatrix(); 
}

void GLPrimitive::vector( Vector3f vector, Vector3f pos, Material *mat){
	glPushMatrix(); 
	Matrix4f tt;
	tt.setRotation( vector , Vector3f(0,1,0) );
	tt.translate( pos );
	float transform[16]; 
	tt.get(transform); 
	glMultMatrixf(transform); 

if(mat!=NULL){

	mat->gl();

}
	float r = vector.size();
	glBegin(GL_TRIANGLES);
	glNormal3f( (0.156434) , (0.987688), 0);
	glVertex3f(0,0,0);
	glNormal3f( (0.309017) , (0.951057), 0);
	glVertex3f(r*(0.0154508),r*(0.0475528),-r*(0.8));
	glNormal3f( (0) , (1), 0);
	glVertex3f(r*(0),r*(0.05),-r*(0.8));
	glNormal3f( (0.156434) , (0.987688), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (0) , (1), 0);
	glVertex3f(r*(0),r*(0.1),-r*(0.8));
	glNormal3f( (0.309017) , (0.951057), 0);
	glVertex3f(r*(0.0309017),r*(0.0951057),-r*(0.8));
	glNormal3f( (0.45399) , (0.891007), 0);
	glVertex3f(0,0,0);
	glNormal3f( (0.587785) , (0.809017), 0);
	glVertex3f(r*(0.0293893),r*(0.0404508),-r*(0.8));
	glNormal3f( (0.309017) , (0.951057), 0);
	glVertex3f(r*(0.0154508),r*(0.0475528),-r*(0.8));
	glNormal3f( (0.45399) , (0.891007), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (0.309017) , (0.951057), 0);
	glVertex3f(r*(0.0309017),r*(0.0951057),-r*(0.8));
	glNormal3f( (0.587785) , (0.809017), 0);
	glVertex3f(r*(0.0587785),r*(0.0809017),-r*(0.8));
	glNormal3f( (0.707107) , (0.707107), 0);
	glVertex3f(0,0,0);
	glNormal3f( (0.809017) , (0.587785), 0);
	glVertex3f(r*(0.0404508),r*(0.0293893),-r*(0.8));
	glNormal3f( (0.587785) , (0.809017), 0);
	glVertex3f(r*(0.0293893),r*(0.0404508),-r*(0.8));
	glNormal3f( (0.707107) , (0.707107), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (0.587785) , (0.809017), 0);
	glVertex3f(r*(0.0587785),r*(0.0809017),-r*(0.8));
	glNormal3f( (0.809017) , (0.587785), 0);
	glVertex3f(r*(0.0809017),r*(0.0587785),-r*(0.8));
	glNormal3f( (0.891007) , (0.45399), 0);
	glVertex3f(0,0,0);
	glNormal3f( (0.951057) , (0.309017), 0);
	glVertex3f(r*(0.0475528),r*(0.0154508),-r*(0.8));
	glNormal3f( (0.809017) , (0.587785), 0);
	glVertex3f(r*(0.0404508),r*(0.0293893),-r*(0.8));
	glNormal3f( (0.891007) , (0.45399), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (0.809017) , (0.587785), 0);
	glVertex3f(r*(0.0809017),r*(0.0587785),-r*(0.8));
	glNormal3f( (0.951057) , (0.309017), 0);
	glVertex3f(r*(0.0951057),r*(0.0309017),-r*(0.8));
	glNormal3f( (0.987688) , (0.156434), 0);
	glVertex3f(0,0,0);
	glNormal3f( (1) , (6.12323e-17), 0);
	glVertex3f(r*(0.05),r*(3.06162e-18),-r*(0.8));
	glNormal3f( (0.951057) , (0.309017), 0);
	glVertex3f(r*(0.0475528),r*(0.0154508),-r*(0.8));
	glNormal3f( (0.987688) , (0.156434), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (0.951057) , (0.309017), 0);
	glVertex3f(r*(0.0951057),r*(0.0309017),-r*(0.8));
	glNormal3f( (1) , (6.12323e-17), 0);
	glVertex3f(r*(0.1),r*(6.12323e-18),-r*(0.8));
	glNormal3f( (0.987688) , (-0.156434), 0);
	glVertex3f(0,0,0);
	glNormal3f( (0.951057) , (-0.309017), 0);
	glVertex3f(r*(0.0475528),r*(-0.0154508),-r*(0.8));
	glNormal3f( (1) , (6.12323e-17), 0);
	glVertex3f(r*(0.05),r*(3.06162e-18),-r*(0.8));
	glNormal3f( (0.987688) , (-0.156434), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (1) , (6.12323e-17), 0);
	glVertex3f(r*(0.1),r*(6.12323e-18),-r*(0.8));
	glNormal3f( (0.951057) , (-0.309017), 0);
	glVertex3f(r*(0.0951057),r*(-0.0309017),-r*(0.8));
	glNormal3f( (0.891007) , (-0.45399), 0);
	glVertex3f(0,0,0);
	glNormal3f( (0.809017) , (-0.587785), 0);
	glVertex3f(r*(0.0404508),r*(-0.0293893),-r*(0.8));
	glNormal3f( (0.951057) , (-0.309017), 0);
	glVertex3f(r*(0.0475528),r*(-0.0154508),-r*(0.8));
	glNormal3f( (0.891007) , (-0.45399), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (0.951057) , (-0.309017), 0);
	glVertex3f(r*(0.0951057),r*(-0.0309017),-r*(0.8));
	glNormal3f( (0.809017) , (-0.587785), 0);
	glVertex3f(r*(0.0809017),r*(-0.0587785),-r*(0.8));
	glNormal3f( (0.707107) , (-0.707107), 0);
	glVertex3f(0,0,0);
	glNormal3f( (0.587785) , (-0.809017), 0);
	glVertex3f(r*(0.0293893),r*(-0.0404508),-r*(0.8));
	glNormal3f( (0.809017) , (-0.587785), 0);
	glVertex3f(r*(0.0404508),r*(-0.0293893),-r*(0.8));
	glNormal3f( (0.707107) , (-0.707107), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (0.809017) , (-0.587785), 0);
	glVertex3f(r*(0.0809017),r*(-0.0587785),-r*(0.8));
	glNormal3f( (0.587785) , (-0.809017), 0);
	glVertex3f(r*(0.0587785),r*(-0.0809017),-r*(0.8));
	glNormal3f( (0.45399) , (-0.891007), 0);
	glVertex3f(0,0,0);
	glNormal3f( (0.309017) , (-0.951057), 0);
	glVertex3f(r*(0.0154508),r*(-0.0475528),-r*(0.8));
	glNormal3f( (0.587785) , (-0.809017), 0);
	glVertex3f(r*(0.0293893),r*(-0.0404508),-r*(0.8));
	glNormal3f( (0.45399) , (-0.891007), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (0.587785) , (-0.809017), 0);
	glVertex3f(r*(0.0587785),r*(-0.0809017),-r*(0.8));
	glNormal3f( (0.309017) , (-0.951057), 0);
	glVertex3f(r*(0.0309017),r*(-0.0951057),-r*(0.8));
	glNormal3f( (0.156434) , (-0.987688), 0);
	glVertex3f(0,0,0);
	glNormal3f( (1.22465e-16) , (-1), 0);
	glVertex3f(r*(6.12323e-18),r*(-0.05),-r*(0.8));
	glNormal3f( (0.309017) , (-0.951057), 0);
	glVertex3f(r*(0.0154508),r*(-0.0475528),-r*(0.8));
	glNormal3f( (0.156434) , (-0.987688), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (0.309017) , (-0.951057), 0);
	glVertex3f(r*(0.0309017),r*(-0.0951057),-r*(0.8));
	glNormal3f( (1.22465e-16) , (-1), 0);
	glVertex3f(r*(1.22465e-17),r*(-0.1),-r*(0.8));
	glNormal3f( (-0.156434) , (-0.987688), 0);
	glVertex3f(0,0,0);
	glNormal3f( (-0.309017) , (-0.951057), 0);
	glVertex3f(r*(-0.0154508),r*(-0.0475528),-r*(0.8));
	glNormal3f( (1.22465e-16) , (-1), 0);
	glVertex3f(r*(6.12323e-18),r*(-0.05),-r*(0.8));
	glNormal3f( (-0.156434) , (-0.987688), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (1.22465e-16) , (-1), 0);
	glVertex3f(r*(1.22465e-17),r*(-0.1),-r*(0.8));
	glNormal3f( (-0.309017) , (-0.951057), 0);
	glVertex3f(r*(-0.0309017),r*(-0.0951057),-r*(0.8));
	glNormal3f( (-0.45399) , (-0.891007), 0);
	glVertex3f(0,0,0);
	glNormal3f( (-0.587785) , (-0.809017), 0);
	glVertex3f(r*(-0.0293893),r*(-0.0404508),-r*(0.8));
	glNormal3f( (-0.309017) , (-0.951057), 0);
	glVertex3f(r*(-0.0154508),r*(-0.0475528),-r*(0.8));
	glNormal3f( (-0.45399) , (-0.891007), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (-0.309017) , (-0.951057), 0);
	glVertex3f(r*(-0.0309017),r*(-0.0951057),-r*(0.8));
	glNormal3f( (-0.587785) , (-0.809017), 0);
	glVertex3f(r*(-0.0587785),r*(-0.0809017),-r*(0.8));
	glNormal3f( (-0.707107) , (-0.707107), 0);
	glVertex3f(0,0,0);
	glNormal3f( (-0.809017) , (-0.587785), 0);
	glVertex3f(r*(-0.0404508),r*(-0.0293893),-r*(0.8));
	glNormal3f( (-0.587785) , (-0.809017), 0);
	glVertex3f(r*(-0.0293893),r*(-0.0404508),-r*(0.8));
	glNormal3f( (-0.707107) , (-0.707107), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (-0.587785) , (-0.809017), 0);
	glVertex3f(r*(-0.0587785),r*(-0.0809017),-r*(0.8));
	glNormal3f( (-0.809017) , (-0.587785), 0);
	glVertex3f(r*(-0.0809017),r*(-0.0587785),-r*(0.8));
	glNormal3f( (-0.891007) , (-0.45399), 0);
	glVertex3f(0,0,0);
	glNormal3f( (-0.951057) , (-0.309017), 0);
	glVertex3f(r*(-0.0475528),r*(-0.0154508),-r*(0.8));
	glNormal3f( (-0.809017) , (-0.587785), 0);
	glVertex3f(r*(-0.0404508),r*(-0.0293893),-r*(0.8));
	glNormal3f( (-0.891007) , (-0.45399), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (-0.809017) , (-0.587785), 0);
	glVertex3f(r*(-0.0809017),r*(-0.0587785),-r*(0.8));
	glNormal3f( (-0.951057) , (-0.309017), 0);
	glVertex3f(r*(-0.0951057),r*(-0.0309017),-r*(0.8));
	glNormal3f( (-0.987688) , (-0.156434), 0);
	glVertex3f(0,0,0);
	glNormal3f( (-1) , (-1.83697e-16), 0);
	glVertex3f(r*(-0.05),r*(-9.18485e-18),-r*(0.8));
	glNormal3f( (-0.951057) , (-0.309017), 0);
	glVertex3f(r*(-0.0475528),r*(-0.0154508),-r*(0.8));
	glNormal3f( (-0.987688) , (-0.156434), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (-0.951057) , (-0.309017), 0);
	glVertex3f(r*(-0.0951057),r*(-0.0309017),-r*(0.8));
	glNormal3f( (-1) , (-1.83697e-16), 0);
	glVertex3f(r*(-0.1),r*(-1.83697e-17),-r*(0.8));
	glNormal3f( (-0.987688) , (0.156434), 0);
	glVertex3f(0,0,0);
	glNormal3f( (-0.951057) , (0.309017), 0);
	glVertex3f(r*(-0.0475528),r*(0.0154508),-r*(0.8));
	glNormal3f( (-1) , (-1.83697e-16), 0);
	glVertex3f(r*(-0.05),r*(-9.18485e-18),-r*(0.8));
	glNormal3f( (-0.987688) , (0.156434), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (-1) , (-1.83697e-16), 0);
	glVertex3f(r*(-0.1),r*(-1.83697e-17),-r*(0.8));
	glNormal3f( (-0.951057) , (0.309017), 0);
	glVertex3f(r*(-0.0951057),r*(0.0309017),-r*(0.8));
	glNormal3f( (-0.891007) , (0.45399), 0);
	glVertex3f(0,0,0);
	glNormal3f( (-0.809017) , (0.587785), 0);
	glVertex3f(r*(-0.0404508),r*(0.0293893),-r*(0.8));
	glNormal3f( (-0.951057) , (0.309017), 0);
	glVertex3f(r*(-0.0475528),r*(0.0154508),-r*(0.8));
	glNormal3f( (-0.891007) , (0.45399), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (-0.951057) , (0.309017), 0);
	glVertex3f(r*(-0.0951057),r*(0.0309017),-r*(0.8));
	glNormal3f( (-0.809017) , (0.587785), 0);
	glVertex3f(r*(-0.0809017),r*(0.0587785),-r*(0.8));
	glNormal3f( (-0.707107) , (0.707107), 0);
	glVertex3f(0,0,0);
	glNormal3f( (-0.587785) , (0.809017), 0);
	glVertex3f(r*(-0.0293893),r*(0.0404508),-r*(0.8));
	glNormal3f( (-0.809017) , (0.587785), 0);
	glVertex3f(r*(-0.0404508),r*(0.0293893),-r*(0.8));
	glNormal3f( (-0.707107) , (0.707107), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (-0.809017) , (0.587785), 0);
	glVertex3f(r*(-0.0809017),r*(0.0587785),-r*(0.8));
	glNormal3f( (-0.587785) , (0.809017), 0);
	glVertex3f(r*(-0.0587785),r*(0.0809017),-r*(0.8));
	glNormal3f( (-0.45399) , (0.891007), 0);
	glVertex3f(0,0,0);
	glNormal3f( (-0.309017) , (0.951057), 0);
	glVertex3f(r*(-0.0154508),r*(0.0475528),-r*(0.8));
	glNormal3f( (-0.587785) , (0.809017), 0);
	glVertex3f(r*(-0.0293893),r*(0.0404508),-r*(0.8));
	glNormal3f( (-0.45399) , (0.891007), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (-0.587785) , (0.809017), 0);
	glVertex3f(r*(-0.0587785),r*(0.0809017),-r*(0.8));
	glNormal3f( (-0.309017) , (0.951057), 0);
	glVertex3f(r*(-0.0309017),r*(0.0951057),-r*(0.8));
	glNormal3f( (-0.156434) , (0.987688), 0);
	glVertex3f(0,0,0);
	glNormal3f( (-2.44929e-16) , (1), 0);
	glVertex3f(r*(-1.22465e-17),r*(0.05),-r*(0.8));
	glNormal3f( (-0.309017) , (0.951057), 0);
	glVertex3f(r*(-0.0154508),r*(0.0475528),-r*(0.8));
	glNormal3f( (-0.156434) , (0.987688), 0);
	glVertex3f(0,0,-r);
	glNormal3f( (-0.309017) , (0.951057), 0);
	glVertex3f(r*(-0.0309017),r*(0.0951057),-r*(0.8));
	glNormal3f( (-2.44929e-16) , (1), 0);
	glVertex3f(r*(-2.44929e-17),r*(0.1),-r*(0.8));
	glEnd();
	glBegin(GL_QUADS);
	glNormal3f( 0, 0, 1);
	glVertex3f(r*(0.0154508),r*(0.0475528),-r*(0.8));
	glVertex3f(r*(0.0309017),r*(0.0951057),-r*(0.8));
	glVertex3f(r*(0),r*(0.1),-r*(0.8));
	glVertex3f(r*(0),r*(0.05),-r*(0.8));
	glVertex3f(r*(0.0293893),r*(0.0404508),-r*(0.8));
	glVertex3f(r*(0.0587785),r*(0.0809017),-r*(0.8));
	glVertex3f(r*(0.0309017),r*(0.0951057),-r*(0.8));
	glVertex3f(r*(0.0154508),r*(0.0475528),-r*(0.8));
	glVertex3f(r*(0.0404508),r*(0.0293893),-r*(0.8));
	glVertex3f(r*(0.0809017),r*(0.0587785),-r*(0.8));
	glVertex3f(r*(0.0587785),r*(0.0809017),-r*(0.8));
	glVertex3f(r*(0.0293893),r*(0.0404508),-r*(0.8));
	glVertex3f(r*(0.0475528),r*(0.0154508),-r*(0.8));
	glVertex3f(r*(0.0951057),r*(0.0309017),-r*(0.8));
	glVertex3f(r*(0.0809017),r*(0.0587785),-r*(0.8));
	glVertex3f(r*(0.0404508),r*(0.0293893),-r*(0.8));
	glVertex3f(r*(0.05),r*(3.06162e-18),-r*(0.8));
	glVertex3f(r*(0.1),r*(6.12323e-18),-r*(0.8));
	glVertex3f(r*(0.0951057),r*(0.0309017),-r*(0.8));
	glVertex3f(r*(0.0475528),r*(0.0154508),-r*(0.8));
	glVertex3f(r*(0.0475528),r*(-0.0154508),-r*(0.8));
	glVertex3f(r*(0.0951057),r*(-0.0309017),-r*(0.8));
	glVertex3f(r*(0.1),r*(6.12323e-18),-r*(0.8));
	glVertex3f(r*(0.05),r*(3.06162e-18),-r*(0.8));
	glVertex3f(r*(0.0404508),r*(-0.0293893),-r*(0.8));
	glVertex3f(r*(0.0809017),r*(-0.0587785),-r*(0.8));
	glVertex3f(r*(0.0951057),r*(-0.0309017),-r*(0.8));
	glVertex3f(r*(0.0475528),r*(-0.0154508),-r*(0.8));
	glVertex3f(r*(0.0293893),r*(-0.0404508),-r*(0.8));
	glVertex3f(r*(0.0587785),r*(-0.0809017),-r*(0.8));
	glVertex3f(r*(0.0809017),r*(-0.0587785),-r*(0.8));
	glVertex3f(r*(0.0404508),r*(-0.0293893),-r*(0.8));
	glVertex3f(r*(0.0154508),r*(-0.0475528),-r*(0.8));
	glVertex3f(r*(0.0309017),r*(-0.0951057),-r*(0.8));
	glVertex3f(r*(0.0587785),r*(-0.0809017),-r*(0.8));
	glVertex3f(r*(0.0293893),r*(-0.0404508),-r*(0.8));
	glVertex3f(r*(6.12323e-18),r*(-0.05),-r*(0.8));
	glVertex3f(r*(1.22465e-17),r*(-0.1),-r*(0.8));
	glVertex3f(r*(0.0309017),r*(-0.0951057),-r*(0.8));
	glVertex3f(r*(0.0154508),r*(-0.0475528),-r*(0.8));
	glVertex3f(r*(-0.0154508),r*(-0.0475528),-r*(0.8));
	glVertex3f(r*(-0.0309017),r*(-0.0951057),-r*(0.8));
	glVertex3f(r*(1.22465e-17),r*(-0.1),-r*(0.8));
	glVertex3f(r*(6.12323e-18),r*(-0.05),-r*(0.8));
	glVertex3f(r*(-0.0293893),r*(-0.0404508),-r*(0.8));
	glVertex3f(r*(-0.0587785),r*(-0.0809017),-r*(0.8));
	glVertex3f(r*(-0.0309017),r*(-0.0951057),-r*(0.8));
	glVertex3f(r*(-0.0154508),r*(-0.0475528),-r*(0.8));
	glVertex3f(r*(-0.0404508),r*(-0.0293893),-r*(0.8));
	glVertex3f(r*(-0.0809017),r*(-0.0587785),-r*(0.8));
	glVertex3f(r*(-0.0587785),r*(-0.0809017),-r*(0.8));
	glVertex3f(r*(-0.0293893),r*(-0.0404508),-r*(0.8));
	glVertex3f(r*(-0.0475528),r*(-0.0154508),-r*(0.8));
	glVertex3f(r*(-0.0951057),r*(-0.0309017),-r*(0.8));
	glVertex3f(r*(-0.0809017),r*(-0.0587785),-r*(0.8));
	glVertex3f(r*(-0.0404508),r*(-0.0293893),-r*(0.8));
	glVertex3f(r*(-0.05),r*(-9.18485e-18),-r*(0.8));
	glVertex3f(r*(-0.1),r*(-1.83697e-17),-r*(0.8));
	glVertex3f(r*(-0.0951057),r*(-0.0309017),-r*(0.8));
	glVertex3f(r*(-0.0475528),r*(-0.0154508),-r*(0.8));
	glVertex3f(r*(-0.0475528),r*(0.0154508),-r*(0.8));
	glVertex3f(r*(-0.0951057),r*(0.0309017),-r*(0.8));
	glVertex3f(r*(-0.1),r*(-1.83697e-17),-r*(0.8));
	glVertex3f(r*(-0.05),r*(-9.18485e-18),-r*(0.8));
	glVertex3f(r*(-0.0404508),r*(0.0293893),-r*(0.8));
	glVertex3f(r*(-0.0809017),r*(0.0587785),-r*(0.8));
	glVertex3f(r*(-0.0951057),r*(0.0309017),-r*(0.8));
	glVertex3f(r*(-0.0475528),r*(0.0154508),-r*(0.8));
	glVertex3f(r*(-0.0293893),r*(0.0404508),-r*(0.8));
	glVertex3f(r*(-0.0587785),r*(0.0809017),-r*(0.8));
	glVertex3f(r*(-0.0809017),r*(0.0587785),-r*(0.8));
	glVertex3f(r*(-0.0404508),r*(0.0293893),-r*(0.8));
	glVertex3f(r*(-0.0154508),r*(0.0475528),-r*(0.8));
	glVertex3f(r*(-0.0309017),r*(0.0951057),-r*(0.8));
	glVertex3f(r*(-0.0587785),r*(0.0809017),-r*(0.8));
	glVertex3f(r*(-0.0293893),r*(0.0404508),-r*(0.8));
	glVertex3f(r*(-1.22465e-17),r*(0.05),-r*(0.8));
	glVertex3f(r*(-2.44929e-17),r*(0.1),-r*(0.8));
	glVertex3f(r*(-0.0309017),r*(0.0951057),-r*(0.8));
	glVertex3f(r*(-0.0154508),r*(0.0475528),-r*(0.8));
	glEnd();
	glPopMatrix(); 
}

void GLPrimitive::bb_circle(float r, Material *mat){
	//PARAM: r : ray

if(mat!=NULL){

	mat->gl();

}
	glBegin(GL_LINE_LOOP);
	glNormal3f(0,0,1);
	glVertex3f(r*(1),r*(0),0);
	glVertex3f(r*(0.984808),r*(0.173648),0);
	glVertex3f(r*(0.939693),r*(0.34202),0);
	glVertex3f(r*(0.866025),r*(0.5),0);
	glVertex3f(r*(0.766044),r*(0.642788),0);
	glVertex3f(r*(0.642788),r*(0.766044),0);
	glVertex3f(r*(0.5),r*(0.866025),0);
	glVertex3f(r*(0.34202),r*(0.939693),0);
	glVertex3f(r*(0.173648),r*(0.984808),0);
	glVertex3f(r*(6.12323e-17),r*(1),0);
	glVertex3f(r*(-0.173648),r*(0.984808),0);
	glVertex3f(r*(-0.34202),r*(0.939693),0);
	glVertex3f(r*(-0.5),r*(0.866025),0);
	glVertex3f(r*(-0.642788),r*(0.766044),0);
	glVertex3f(r*(-0.766044),r*(0.642788),0);
	glVertex3f(r*(-0.866025),r*(0.5),0);
	glVertex3f(r*(-0.939693),r*(0.34202),0);
	glVertex3f(r*(-0.984808),r*(0.173648),0);
	glVertex3f(r*(-1),r*(1.22465e-16),0);
	glVertex3f(r*(-0.984808),r*(-0.173648),0);
	glVertex3f(r*(-0.939693),r*(-0.34202),0);
	glVertex3f(r*(-0.866025),r*(-0.5),0);
	glVertex3f(r*(-0.766044),r*(-0.642788),0);
	glVertex3f(r*(-0.642788),r*(-0.766044),0);
	glVertex3f(r*(-0.5),r*(-0.866025),0);
	glVertex3f(r*(-0.34202),r*(-0.939693),0);
	glVertex3f(r*(-0.173648),r*(-0.984808),0);
	glVertex3f(r*(-1.83697e-16),r*(-1),0);
	glVertex3f(r*(0.173648),r*(-0.984808),0);
	glVertex3f(r*(0.34202),r*(-0.939693),0);
	glVertex3f(r*(0.5),r*(-0.866025),0);
	glVertex3f(r*(0.642788),r*(-0.766044),0);
	glVertex3f(r*(0.766044),r*(-0.642788),0);
	glVertex3f(r*(0.866025),r*(-0.5),0);
	glVertex3f(r*(0.939693),r*(-0.34202),0);
	glVertex3f(r*(0.984808),r*(-0.173648),0);
	glVertex3f(r*(1),r*(0),0);
	glEnd();
}

void GLPrimitive::wire_cylinder(float r, float l, Material *mat, Matrix4f *t){
	glPushMatrix(); 
	float transform[16]; 
	t->get(transform); 
	glMultMatrixf(transform); 
glRotatef(90,1,0,0);
	//CYLINDER DIV 1
	//PARAM: r : ray / l : length

if(mat!=NULL){

	mat->gl();

}
	float l_2 = l/2;
	glBegin(GL_QUADS);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0-l_2,r*0);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0+l_2,r*0);
	glEnd();
	glBegin(GL_TRIANGLES);
	glNormal3f(0,-1,0);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glVertex3f(r*1,r*0-l_2,r*0);
	glVertex3f(0,-l_2,0);
	glNormal3f(0,+1,0);
	glVertex3f(r*1,r*0+l_2,r*0);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glVertex3f(0,+l_2,0);
	glEnd();
	glBegin(GL_QUADS);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0-l_2,r*-1);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0+l_2,r*-1);
	glNormal3f(0.707107,0,-0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glEnd();
	glBegin(GL_TRIANGLES);
	glNormal3f(0,-1,0);
	glVertex3f(r*0,r*0-l_2,r*-1);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glVertex3f(0,-l_2,0);
	glNormal3f(0,+1,0);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glVertex3f(r*0,r*0+l_2,r*-1);
	glVertex3f(0,+l_2,0);
	glEnd();
	glBegin(GL_QUADS);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0-l_2,r*-1);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glNormal3f(0,0,-1);
	glVertex3f(r*0,r*0+l_2,r*-1);
	glEnd();
	glBegin(GL_TRIANGLES);
	glNormal3f(0,-1,0);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glVertex3f(r*0,r*0-l_2,r*-1);
	glVertex3f(0,-l_2,0);
	glNormal3f(0,+1,0);
	glVertex3f(r*0,r*0+l_2,r*-1);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glVertex3f(0,+l_2,0);
	glEnd();
	glBegin(GL_QUADS);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0-l_2,r*0);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0+l_2,r*0);
	glNormal3f(-0.707107,0,-0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glEnd();
	glBegin(GL_TRIANGLES);
	glNormal3f(0,-1,0);
	glVertex3f(r*-1,r*0-l_2,r*0);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glVertex3f(0,-l_2,0);
	glNormal3f(0,+1,0);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glVertex3f(r*-1,r*0+l_2,r*0);
	glVertex3f(0,+l_2,0);
	glEnd();
	glBegin(GL_QUADS);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0-l_2,r*0);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glNormal3f(-1,0,0);
	glVertex3f(r*-1,r*0+l_2,r*0);
	glEnd();
	glBegin(GL_TRIANGLES);
	glNormal3f(0,-1,0);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glVertex3f(r*-1,r*0-l_2,r*0);
	glVertex3f(0,-l_2,0);
	glNormal3f(0,+1,0);
	glVertex3f(r*-1,r*0+l_2,r*0);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glVertex3f(0,+l_2,0);
	glEnd();
	glBegin(GL_QUADS);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0-l_2,r*1);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0+l_2,r*1);
	glNormal3f(-0.707107,0,0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glEnd();
	glBegin(GL_TRIANGLES);
	glNormal3f(0,-1,0);
	glVertex3f(r*0,r*0-l_2,r*1);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glVertex3f(0,-l_2,0);
	glNormal3f(0,+1,0);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glVertex3f(r*0,r*0+l_2,r*1);
	glVertex3f(0,+l_2,0);
	glEnd();
	glBegin(GL_QUADS);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0-l_2,r*1);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glNormal3f(0,0,1);
	glVertex3f(r*0,r*0+l_2,r*1);
	glEnd();
	glBegin(GL_TRIANGLES);
	glNormal3f(0,-1,0);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glVertex3f(r*0,r*0-l_2,r*1);
	glVertex3f(0,-l_2,0);
	glNormal3f(0,+1,0);
	glVertex3f(r*0,r*0+l_2,r*1);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glVertex3f(0,+l_2,0);
	glEnd();
	glBegin(GL_QUADS);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0-l_2,r*0);
	glNormal3f(1,0,0);
	glVertex3f(r*1,r*0+l_2,r*0);
	glNormal3f(0.707107,0,0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glEnd();
	glBegin(GL_TRIANGLES);
	glNormal3f(0,-1,0);
	glVertex3f(r*1,r*0-l_2,r*0);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glVertex3f(0,-l_2,0);
	glNormal3f(0,+1,0);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glVertex3f(r*1,r*0+l_2,r*0);
	glVertex3f(0,+l_2,0);
	glEnd();
	glPopMatrix(); 
}

void GLPrimitive::wire_capsule(float r, float l, Material *mat, Matrix4f *t){
	glPushMatrix(); 
	float transform[16]; 
	t->get(transform); 
	glMultMatrixf(transform); 
glRotatef(90,1,0,0);
	//SPHERE DIV 1
	//PARAM: r : ray / l : length

if(mat!=NULL){

	mat->gl();

}
	float l_2 = l/2;
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*0.707107+l_2,r*0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glVertex3f(r*0.707107,r*0.707107+l_2,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*1+l_2,r*0);
	glVertex3f(r*0,r*0.707107+l_2,r*0.707107);
	glVertex3f(r*0.707107,r*0.707107+l_2,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*0+l_2,r*1);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glVertex3f(r*0,r*0.707107+l_2,r*0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*1,r*0+l_2,r*0);
	glVertex3f(r*0.707107,r*0.707107+l_2,r*0);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0.707107,r*0.707107+l_2,r*0);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glVertex3f(r*0,r*0.707107+l_2,r*-0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*1+l_2,r*0);
	glVertex3f(r*0.707107,r*0.707107+l_2,r*0);
	glVertex3f(r*0,r*0.707107+l_2,r*-0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*1,r*0+l_2,r*0);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glVertex3f(r*0.707107,r*0.707107+l_2,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*0+l_2,r*-1);
	glVertex3f(r*0,r*0.707107+l_2,r*-0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*0.707107+l_2,r*-0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glVertex3f(r*-0.707107,r*0.707107+l_2,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*1+l_2,r*0);
	glVertex3f(r*0,r*0.707107+l_2,r*-0.707107);
	glVertex3f(r*-0.707107,r*0.707107+l_2,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*0+l_2,r*-1);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glVertex3f(r*0,r*0.707107+l_2,r*-0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*-1,r*0+l_2,r*0);
	glVertex3f(r*-0.707107,r*0.707107+l_2,r*0);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*-0.707107,r*0.707107+l_2,r*0);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glVertex3f(r*0,r*0.707107+l_2,r*0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*1+l_2,r*0);
	glVertex3f(r*-0.707107,r*0.707107+l_2,r*0);
	glVertex3f(r*0,r*0.707107+l_2,r*0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*-1,r*0+l_2,r*0);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glVertex3f(r*-0.707107,r*0.707107+l_2,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*0+l_2,r*1);
	glVertex3f(r*0,r*0.707107+l_2,r*0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0.707107,r*-0.707107-l_2,r*0);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glVertex3f(r*0,r*-0.707107-l_2,r*0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*-1-l_2,r*0);
	glVertex3f(r*0.707107,r*-0.707107-l_2,r*0);
	glVertex3f(r*0,r*-0.707107-l_2,r*0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*1,r*0-l_2,r*0);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glVertex3f(r*0.707107,r*-0.707107-l_2,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*0-l_2,r*1);
	glVertex3f(r*0,r*-0.707107-l_2,r*0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*-0.707107-l_2,r*-0.707107);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glVertex3f(r*0.707107,r*-0.707107-l_2,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*-1-l_2,r*0);
	glVertex3f(r*0,r*-0.707107-l_2,r*-0.707107);
	glVertex3f(r*0.707107,r*-0.707107-l_2,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*0-l_2,r*-1);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glVertex3f(r*0,r*-0.707107-l_2,r*-0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*1,r*0-l_2,r*0);
	glVertex3f(r*0.707107,r*-0.707107-l_2,r*0);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*-0.707107,r*-0.707107-l_2,r*0);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glVertex3f(r*0,r*-0.707107-l_2,r*-0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*-1-l_2,r*0);
	glVertex3f(r*-0.707107,r*-0.707107-l_2,r*0);
	glVertex3f(r*0,r*-0.707107-l_2,r*-0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*-1,r*0-l_2,r*0);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glVertex3f(r*-0.707107,r*-0.707107-l_2,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*0-l_2,r*-1);
	glVertex3f(r*0,r*-0.707107-l_2,r*-0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*-0.707107-l_2,r*0.707107);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glVertex3f(r*-0.707107,r*-0.707107-l_2,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*-1-l_2,r*0);
	glVertex3f(r*0,r*-0.707107-l_2,r*0.707107);
	glVertex3f(r*-0.707107,r*-0.707107-l_2,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*0-l_2,r*1);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glVertex3f(r*0,r*-0.707107-l_2,r*0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*-1,r*0-l_2,r*0);
	glVertex3f(r*-0.707107,r*-0.707107-l_2,r*0);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*1,r*0-l_2,r*0);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glVertex3f(r*1,r*0+l_2,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0.707107,r*0-l_2,r*-0.707107);
	glVertex3f(r*0,r*0-l_2,r*-1);
	glVertex3f(r*0,r*0+l_2,r*-1);
	glVertex3f(r*0.707107,r*0+l_2,r*-0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*0-l_2,r*-1);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glVertex3f(r*0,r*0+l_2,r*-1);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*-0.707107,r*0-l_2,r*-0.707107);
	glVertex3f(r*-1,r*0-l_2,r*0);
	glVertex3f(r*-1,r*0+l_2,r*0);
	glVertex3f(r*-0.707107,r*0+l_2,r*-0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*-1,r*0-l_2,r*0);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glVertex3f(r*-1,r*0+l_2,r*0);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*-0.707107,r*0-l_2,r*0.707107);
	glVertex3f(r*0,r*0-l_2,r*1);
	glVertex3f(r*0,r*0+l_2,r*1);
	glVertex3f(r*-0.707107,r*0+l_2,r*0.707107);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0,r*0-l_2,r*1);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glVertex3f(r*0,r*0+l_2,r*1);
	glEnd();
	glBegin(GL_LINE_LOOP);
	glVertex3f(r*0.707107,r*0-l_2,r*0.707107);
	glVertex3f(r*1,r*0-l_2,r*0);
	glVertex3f(r*1,r*0+l_2,r*0);
	glVertex3f(r*0.707107,r*0+l_2,r*0.707107);
	glEnd();
	glPopMatrix(); 
}

